C++ linking?
How do I link a C++ program properly? gcc complains of a lot of unresolved symbols when I use just gcc foo.cpp. Is there some library I have to link against.?
|
You definitely have to link your program with some libraries. But which librarires you should link is depends of your program. See also -L -l and -I options for gcc.
|
i believe the command to compile a C++ program is using g++ instead of gcc. maybe you could try that first?
|
I highly doubt it. gcc is supposedly able to handle c, c++, and asm and linking of obj code. Besides, my code uses c++ keywords, which would cause syntax errors ona regular c compiler which it didn't. The errors only appeared during linking.
|
you should listen to gui :) only g++ automatically links in the required c++ libraries, gcc will give linker errors for c++ programs
|
Quote:
|
All times are GMT -5. The time now is 03:25 PM. |