views:

263

answers:

2

I am trying to compile a boost.asio example, but I get the following linker errors: "undefined reference to _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!

A: 

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

interjay
I read that somewhere, but how do I change the compiler in DevC++? (I forgot to mention, I use that program)
Levo
My project is A c++ project already.
Levo
A: 

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
$
Dirk Eddelbuettel
I haven't tested it yet, the new kernel doesn't work with the custom display driver.... I'll test it as soon as I fix it.
Levo
Huh? The kernel and display have nothing to do with your use of g++. I simply pointed out to you that the Boost example builds fine. If you have different header locations, you may need a -I.
Dirk Eddelbuettel
I CAN'T TEST AT THE MOMENT! DO YOU SPEAK ENGLISH???
Levo
Can you speak up a little? I can't hear you among all the screaming.
Dirk Eddelbuettel