How to specify libraries for the linker
Thu Dec 4 15:08:00 GMT 2003


I`m trying to link my Test.o file to exe file, but the linker 
can`t find any libraries. I think it want`s the standard library.

1. I compiled my Test.cpp file -> OK
2. in the same directory I tried the following:
   gcc -o Test.exe Test.o

-> output:

Test.o(.text+0xf):Test.cpp: undefined reference to `operator new(unsigned
Test.o(.text+0x2e):Test.cpp: undefined reference to `operator delete(void*)'
Testi.o(.text+0x5e):Test.cpp: undefined reference to
Test.o(.text+0xbc):Test.cpp: undefined reference to
Test.o(.gnu.linkonce.t._ZN5Testi7printEv+0xf):Test.cpp: undefined reference to

I tried to use the -l and -L flags but I dont know what to put after that,
because I dont`t know what libraries I need and where do they reside (\lib

Could somebody be so kind to help me. I`d need to know how to
do the job and tell me what libraries I need for standard C++ programs.



More information about the Gcc-help mailing list