Hi
I have a program in which my video routines are in a secndary module video.c, its prototypes are in video.h. My main function is in a module called main.c. My Main function at the moment calls just one of the video routines and it compiles fine but I get a linker error:
?Linker Error: Undefined symbol _Print_Char in module MAIN.C
I include the header file just fine and it compiles so what is going wrong?
Thanks
Multiple module problems in Turbo C++
Re:Multiple module problems in Turbo C++
Are you actually linking both object files after compiling them? The header file just lets the compiler know the functions are available; it doesn't include them into the output. You need to specify the names of both object files on the linker command line.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Multiple module problems in Turbo C++
did you give both video.o and main.o files to the linker ?
the trick is to compile your file separately ( *.c -> *.o) and then to give all .o files to the linker in order to produce a single .bin file
the trick is to compile your file separately ( *.c -> *.o) and then to give all .o files to the linker in order to produce a single .bin file
Re:Multiple module problems in Turbo C++
I just went run in the run menu of the IDEPype.Clicker wrote: did you give both video.o and main.o files to the linker ?
the trick is to compile your file separately ( *.c -> *.o) and then to give all .o files to the linker in order to produce a single .bin file
Re:Multiple module problems in Turbo C++
hmm Interesting, it worked fine from the command line, is the IDE crap?? Shame if it is , as the Turbo Pascal one was great (for Pascal of course )I just went run in the run menu of the IDE
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Multiple module problems in Turbo C++
you cannot just run if you have a multi-module project: you must build it first.... unlike pascal, C isn't interpretable...
Re:Multiple module problems in Turbo C++
Pype.Clicker means to say that, unlike Pascal, C doesn't take care of linking and dependencies for you. You have to compile each source file separately and link them into one executable; to do you, you probably need to create a project and add all your source files there.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Multiple module problems in Turbo C++
hum, yes... tnx for the translation, Tim ... that was one-hand-only typed in a hurry