【发布时间】:2014-02-14 14:42:45
【问题描述】:
我的代码有问题。 我有这样的信息试图建立:
g++ -L /usr/local/boost_1_55_0 -Wall -pedantic -Iinc -c -lboost_system -pthread -lboost_thread -o obj/glo.o src/glo.cpp
g++ -L /usr/local/boost_1_55_0 -Wall -pedantic -Iinc -c -lboost_system -pthread -lboost_thread -o obj/serial.o src/serial.cpp
g++ -I /usr/local/boost_1_55_0 -Wall -lboost_system -pthread -o dwa obj/glo.o obj/serial.o
obj/glo.o: In function `__static_initialization_and_destruction_0(int, int)':
glo.cpp:(.text+0x15a): undefined reference to `boost::system::generic_category()'
glo.cpp:(.text+0x166): undefined reference to `boost::system::generic_category()'
glo.cpp:(.text+0x172): undefined reference to `boost::system::system_category()'
obj/glo.o: In function `boost::system::error_code::error_code()':
glo.cpp:(.text._ZN5boost6system10error_codeC2Ev[_ZN5boost6system10error_codeC5Ev]+0x17): undefined reference to `boost::system::system_category()'
和类似的。
如你所见,我已经给出了
-lboost_system -pthread -lboost_thread and compiled system boost in /usr/local/boost_1_55_0
我不知道发生了什么。
【问题讨论】:
-
尝试将
-lboost_system移动到行的end。 -
它对我有用!谢谢