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.
> 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.