0

我可以使用以下命令成功编译 simple_ls.cpp:

xlc++  -qstrict -brtl -I /usr/local/include -L /usr/local/lib simple_ls.cpp -lboost_filesystem -o simple_ls

但是,当我使用与 path_info.cpp 命令完全相同的语法时,我收到此错误:

xlc++  -qstrict -brtl -I /usr/local/include -L /usr/local/lib path_info.cpp -lboost_filesystem -o path_info
ld: 0711-317 ERROR: Undefined symbol: .boost::system::generic_category()
ld: 0711-317 ERROR: Undefined symbol: .boost::system::system_category()
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
4

1 回答 1

1

您需要将第二个程序与 boost_system 链接。

xlc++ -qstrict -brtl -I /usr/local/include -L /usr/local/lib path_info.cpp -lboost_filesystem -o path_info -lboost_system
于 2012-10-04T13:53:26.280 回答