开发者

Linker error when compiling boost.asio example

I am trying to compile a boost.asio example, but I get the following linker errors: "undefined reference to 开发者_StackOverflow_Unwind_Resume'" and "undefined reference to__gxx_personality_v0'". I've been searching google for a long time, but nothing helped. Which library do I need to link? Thanks in advance!


You're probably using gcc to link your program. If you use g++ instead it will link in the required libraries.

For Dev-C++, see FAQ entry: Dev-C++ uses gcc instead of g++ for linking


Works like a charm on Ubuntu 9.10:

$ g++ -o chat_server -c chat_server.cpp
In file included from chat_server.cpp:21:
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’
$ ls -l chat_server*
-rw-r--r-- 1 edd edd 1233608 2010-01-09 08:17 chat_server
-rw-r--r-- 1 edd edd    6244 2010-01-09 08:17 chat_server.cpp
$
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜