我正在尝试编译的示例来自:http://www.boost.org/doc/libs/1_46_1/doc/html/boost_asio/examples.html (聊天示例)
这是我正在使用它:
>>> g++ chat_client.cpp chat_message.hpp
>>> g++ chat_server.cpp chat_message.hpp
Run Code Online (Sandbox Code Playgroud)
这是终端输出的内容:
% g++ chat_client.cpp chat_message.hpp
In file included from chat_client.cpp:17:
chat_message.hpp: In member function ‘void chat_message::encode_header()’:
chat_message.hpp:84: warning: format ‘%4d’ expects type ‘int’, but argument 3 has type ‘size_t’
ld: warning: in chat_message.hpp, file was built for unsupported file format which is not the architecture being linked (x86_64)
Undefined symbols:
"boost::system::generic_category()", referenced from:
__static_initialization_and_destruction_0(int, int)in cctJA2c1.o
__static_initialization_and_destruction_0(int, int)in cctJA2c1.o
"boost::thread::start_thread()", referenced from:
boost::thread::thread<boost::_bi::bind_t<unsigned long, boost::_mfi::mf0<unsigned long, …Run Code Online (Sandbox Code Playgroud)