Boost logo

Boost Users :

Subject: [Boost-users] Noob question - undefined reference to boost::system::get_system_category
From: mx270a (Lance_at_[hidden])
Date: 2009-05-22 12:32:26


I'm a relatively new to programming on Linux, previous experience was with
VB.net in Windows. I'm trying to make the switch to C++, but I'm having a
difficult time. I started to follow one of the basic tutorials for Boost
ASIO, but I can't get it to compile with the ASIO.hpp file included. The
environment is Kubuntu 9.04 and Kdevelop 3.5.3.

Code:
----------------
#include <boost/asio.hpp>

int main()
{
  return 0;
}
----------------

Compile Messages and Errors:
----------------
cd '/home/lance/TS1/debug' && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1"
LC_MESSAGES="C" LC_CTYPE="C" make -k
make all-recursive
Making all in src
compiling ts1.cpp (g++)
mv -f .deps/ts1.Tpo .deps/ts1.Po
linking ts1 (g++)
linking ts1 (g++)
ts1.o: In function `__static_initialization_and_destruction_0':
/usr/include/boost/system/error_code.hpp:205: undefined reference to
`boost::system::get_system_category()'
/usr/include/boost/system/error_code.hpp:206: undefined reference to
`boost::system::get_generic_category()'
/usr/include/boost/system/error_code.hpp:211: undefined reference to
`boost::system::get_generic_category()'
/usr/include/boost/system/error_code.hpp:212: undefined reference to
`boost::system::get_generic_category()'
/usr/include/boost/system/error_code.hpp:213: undefined reference to
`boost::system::get_system_category()'
ts1.o: In function `boost::asio::error::get_system_category()':
/usr/include/boost/asio/error.hpp:218: undefined reference to
`boost::system::get_system_category()'
ts1.o: In function `posix_tss_ptr':
/usr/include/boost/asio/detail/posix_tss_ptr.hpp:47: undefined reference to
`pthread_key_create'
ts1.o: In function `~posix_tss_ptr':
/usr/include/boost/asio/detail/posix_tss_ptr.hpp:61: undefined reference to
`pthread_key_delete'
collect2: ld returned 1 exit status
make[2]: *** [ts1] Error 1
make[2]: Target `all' not remade because of errors.
make[2]: Nothing to be done for `all-am'.
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
*** Exited with status: 2 ***
----------------

How do I resolve the boost::system errors?

Thanks,
Lance

-- 
View this message in context: http://www.nabble.com/Noob-question---undefined-reference-to-boost%3A%3Asystem%3A%3Aget_system_category-tp23673473p23673473.html
Sent from the Boost - Users mailing list archive at Nabble.com.

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net