symbol lookup error despite the symbol being present in linked library

浪尽此生 提交于 2020-01-16 00:50:16

问题


My executable is linked against several libraries (see below), but at run-time crashes with this error:

symbol lookup error: bin.gcc/TestHarmonic: undefined symbol: _ZN3fmm8harmonic7details6helperILi2ENS0_6U_typeEdE5set_qEPdPKddd

The executable is made using (on linux, running gcc 4.8.1)

g++ -o bin.gcc/TestHarmonic obj.gcc/TestHarmonic.o -Llib/ -lfmm.gcc -Lutils2/lib -lWDutils2.gcc -ltbb -lCGAL -lm

The symbol in question is actually where it ought to be:

nm lib/libfmm.gcc.so | grep _ZN3fmm8harmonic7details6helperILi2ENS0_6U_typeEdE5set_qEPdPKddd
000000000a2fff0 W _ZN3fmm8harmonic7details6helperILi2ENS0_6U_typeEdE5set_qEPdPKddd

The library lib/libfmm.gcc.so is made via

g++ several_files.o -shared -Lutils2/lib -lWDutils2.gcc -ltbb -lCGAL -lm -o lib/libfmm.gcc.so

If I delete that but keep a static version lib/libfmm.gcc.a and build the executable again, it works. What could be wrong here and how can I fix this?

来源:https://stackoverflow.com/questions/26127502/symbol-lookup-error-despite-the-symbol-being-present-in-linked-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!