./TestCppProgram: symbol lookup error: ./TestCppProgram: undefined symbol: _ZN12CppProgramC1EvI searched the internet. Two of the interesting links I found were the following:
- http://osdir.com/ml/gcc.g++.general/2005-02/msg00061.html
- http://www.linuxquestions.org/questions/linux-software-2/undefined-symbol-cout-263568/
Some cool commands in the debugging process:
- ldd TestCppProgram (Shows you where your program is getting it's libraries from. An early-on careful inspection of this would've quickly let me to my problem!)
- ldd -d -r TestCppProgram (Shows you any undefined symbols. There shouldn't be any undefined symbols for an executable, but there will be for a shared lib if it depends on another shared lib. Somebody please correct me if I'm wrong)
- nm TestCppProgram | c++filt (displays unmangled symbol information)
- nm TestCppProgram (Displays mangled symbol information. Ie: You should be able to find stuff like ZN12CppProgramC1Ev in here. In my problem above, I found which line number the undefined symbol in question was on, and then looked it up in the unmangled version to see what function it was trying to resolve. It let me know, but it didn't really help me find out what my problem was.)
- readelf -d TestCppProgram (Shows library dependencies. similar to ldd.)