当我尝试使用链接boost的库libboost_serialization.so构建一些应用程序时,我有以下错误消息:
/usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../x86_64-suse-linux/bin/ld: cannot find -llibboost_serialization
collect2: ld returned 1 exit status
这是ldconfig:
的输出linux-rxa13:/usr/lib64 # ldconfig -p | grep serialization
libboost_wserialization.so.1.46.1 (libc6,x86-64) => /usr/lib64/libboost_wserialization.so.1.46.1
libboost_wserialization.so (libc6,x86-64) => /usr/lib64/libboost_wserialization.so
libboost_serialization.so.1.46.1 (libc6,x86-64) => /usr/lib64/libboost_serialization.so.1.46.1
libboost_serialization.so (libc6,x86-64) => /usr/lib64/libboost_serialization.so
这是构建测试应用程序的命令行:
g++ -o "m" m.o -L/usr/lib64 -llibboost_serialization
我已经搜索了这个问题的解决方案,但我还没找到。谢谢!
答案 0 :(得分:7)
请勿加入lib
:-lboost_serialization
答案 1 :(得分:1)
我从-llibboost_serialization
中删除了“ lib”,它对我有用。最终结果是:
-lboost_serialization