在AIX上遇到一个动态库找不到的问题:
rtld: 0712-001 Symbol __ct__12TimerManagerFv was referenced from module /com/tm/lib/libcore.so(), but a runtime definition of the symbol was not found.
在需要链接这个库的makefile里都加上了:
-L/com/tm/lib/ -lcore
并且链接通过。ldd应用程序也显示:
/com/tm/lib/libcore.so
但是就是运行时提示上边的错误,请问大神这能是什么原因呢??
运行之前加上
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/com/tm/lib
设置动态库搜索路径
AIX requires all symbols to resolve at load-time, so even though it builds OK, because the symbol is referenced the applications will not run.
You need to use lazy linking for the .so (the -blazy link option), which should cause the missing function to be linked only on first use.
生成.so文件的时候加上 -blazy 选项试试
这个Makefile少编译了几个文件,导致了这个问题