PDA

View Full Version : Undefined reference error



SagoO
11-14-2010, 02:06 AM
This is the compile line:
g++ main.cpp -lGLU -lglut -lGL -o pboTest

I had already link the library required. What are the libraries I had left out here? Below are the error message:



/tmp/ccDy0tBQ.o: In function `main':
main.cpp:(.text+0x3e): undefined reference to `glInfo::getInfo()'
main.cpp:(.text+0x180): undefined reference to `glInfo::isExtensionSupported(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&amp;)'
main.cpp:(.text+0x2fe): undefined reference to `Timer::start()'
/tmp/ccDy0tBQ.o: In function `showTransferRate()':
main.cpp:(.text+0xeba): undefined reference to `Timer::Timer()'
main.cpp:(.text+0xecb): undefined reference to `Timer::~Timer()'
main.cpp:(.text+0x100e): undefined reference to `Timer::getElapsedTime()'
main.cpp:(.text+0x118a): undefined reference to `Timer::start()'
/tmp/ccDy0tBQ.o: In function `printTransferRate()':
main.cpp:(.text+0x127c): undefined reference to `Timer::Timer()'
main.cpp:(.text+0x128d): undefined reference to `Timer::~Timer()'
main.cpp:(.text+0x136c): undefined reference to `Timer::getElapsedTime()'
main.cpp:(.text+0x14a0): undefined reference to `Timer::start()'
/tmp/ccDy0tBQ.o: In function `displayCB()':
main.cpp:(.text+0x152d): undefined reference to `Timer::start()'
main.cpp:(.text+0x15b6): undefined reference to `Timer::stop()'
main.cpp:(.text+0x15c2): undefined reference to `Timer::getElapsedTimeInMilliSec()'
main.cpp:(.text+0x15da): undefined reference to `Timer::start()'
main.cpp:(.text+0x1660): undefined reference to `Timer::stop()'
main.cpp:(.text+0x166c): undefined reference to `Timer::getElapsedTimeInMilliSec()'
main.cpp:(.text+0x169d): undefined reference to `Timer::start()'
main.cpp:(.text+0x170b): undefined reference to `Timer::stop()'
main.cpp:(.text+0x1717): undefined reference to `Timer::getElapsedTimeInMilliSec()'
main.cpp:(.text+0x172f): undefined reference to `Timer::start()'
main.cpp:(.text+0x1750): undefined reference to `Timer::stop()'
main.cpp:(.text+0x175c): undefined reference to `Timer::getElapsedTimeInMilliSec()'
/tmp/ccDy0tBQ.o: In function `__static_initialization_and_destruction_0(int, int)':
main.cpp:(.text+0x1cd2): undefined reference to `Timer::Timer()'
main.cpp:(.text+0x1cd7): undefined reference to `Timer::~Timer()'
main.cpp:(.text+0x1cfb): undefined reference to `Timer::Timer()'
main.cpp:(.text+0x1d00): undefined reference to `Timer::~Timer()'
main.cpp:(.text+0x1d24): undefined reference to `Timer::Timer()'
main.cpp:(.text+0x1d29): undefined reference to `Timer::~Timer()'
collect2: ld returned 1 exit status

carsten neumann
11-15-2010, 09:17 AM
I had already link the library required. What are the libraries I had left out here?


That is almost impossible to say, unless someone recognizes the class/function names in your error message - I don't, they are quite generic names. Maybe if you look at your includes you can figure out what other libraries you are using.