我可以使用以下命令成功编译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.
答案 0 :(得分:1)
您需要将第二个程序与boost_system链接。
xlc++ -qstrict -brtl -I /usr/local/include -L /usr/local/lib path_info.cpp -lboost_filesystem -o path_info -lboost_system