问题描述
- 使用tcl8.6共享库,遇到错误提示undefined reference to
-
项目中用到了tcl8.6的共享库,把tcl的源码下载后在ubuntu上将tcl的库编译出来了。但是在编译项目的时候总是报未定义引用的错误,我检查了自己编译出来的libtcl8.6.so,这个共享库中是有tclStringType的定义的,也检查了声明tclStringType的头文件,编译tcl共享库时的头文件与编译项目时的头文件是一致的。以下是共享库符号检查和编译的结果,跪求武林高手出手相帮,不胜感激!
nm -l /home/water/Documents/eaf/kit/test/lib/Linux_3.19.0_i686/liboms_shr.so|grep tclStringType
U tclStringTypenm -l /usr/lib/i386-linux-gnu/libtcl8.6.so|grep tclStringType
001a1034 d tclStringTypegcc -g -o /home/water/Documents/eaf/kit/test/bin/Linux_3.19.0_i686/TableDump Linux_3.19.0_i686/TableDump.o -L/home/water/Documents/eaf/kit/test/lib/Linux_3.19.0_i686 -loms0_shr -L/home/water/Documents/eaf/kit/test/lib/Linux_3.19.0_i686 -loms_shr -L/home/water/Documents/eaf/kit/test/lib/Linux_3.19.0_i686 -lstub -L/usr/lib/i386-linux-gnu -ltcl8.6 -L/usr/lib/i386-linux-gnu -lpthread -L/usr/lib/i386-linux-gnu -lresolv -L/usr/lib/i386-linux-gnu -lm -L/usr/lib/i386-linux-gnu -lc -Xlinker --rpath-link -Xlinker /home/water/Documents/eaf/kit/test/lib/Linux_3.19.0_i686
/home/water/Documents/eaf/kit/test/lib/Linux_3.19.0_i686/liboms_shr.so: undefined reference totclEmptyStringRep'
tclStringType'
/home/water/Documents/eaf/kit/test/lib/Linux_3.19.0_i686/liboms_shr.so: undefined reference to
/home/water/Documents/eaf/kit/test/lib/Linux_3.19.0_i686/liboms_shr.so: undefined reference to `tclFreeObjList'