How to create a project

This is a discussion on How to create a project within the C Programming forums, part of the General Programming Boards category; I have two c files. One is projmain.c and another support.c included in projmain.c. This are some graphics program. When ...

  1. #1
    Registered User nurulsiddik's Avatar
    Join Date
    Feb 2002
    Posts
    8

    Question How to create a project

    I have two c files. One is projmain.c and another support.c included in projmain.c. This are some graphics program. When i create exe in my machine and run it on other machine it gives me the graphics initialization error. Now i create a project i.e (project.prj file). I added those two files and try to compile and run it. It gives me linker errors. Can you explain what is the actual way to create project in turbo c++ editor.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,672
    > One is projmain.c and another support.c included in projmain.c.
    This is wrong - .c files do not include .c files.

    Ok, its a cheap trick to save typing when you have say only 2 files, but you're hosed when you create a project

    Solution is in 2 steps

    1. Out of support.c, create support.h which contains all the function prototypes, structures and external data which is declared in support.c, and which is needed by projmain.c.

    2. Replace #include "support.c" from projmain.c, and replace it with #include "support.h"
    For added safety (in case you modify support.c, also add #include "support.h" to support.c as well.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem about making setup project
    By sgh in forum Windows Programming
    Replies: 0
    Last Post: 04-30-2008, 03:09 AM
  2. How to add a file to a project in bloodshed.
    By Smeep in forum C++ Programming
    Replies: 4
    Last Post: 04-22-2005, 09:29 PM
  3. Project details: Dedicated
    By Stack Overflow in forum Projects and Job Recruitment
    Replies: 9
    Last Post: 02-22-2005, 02:10 PM
  4. Convert C++ project
    By gogo in forum Tech Board
    Replies: 6
    Last Post: 08-12-2004, 07:48 AM
  5. Operating System Project
    By Pete in forum Projects and Job Recruitment
    Replies: 1
    Last Post: 07-15-2004, 09:33 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21