Boost logo

Boost Users :

Subject: Re: [Boost-users] How do you compile Boost C++ code in Ubuntu?
From: Mateusz Loskot (mateusz_at_[hidden])
Date: 2013-02-07 12:53:50


On 7 February 2013 17:08, Giovanni <giovanni.ong_at_[hidden]> wrote:
> g++ -L/usr/lib -lboost_system get_sys_info.cpp
> /tmp/cckONUUl.o: In function
> `__static_initialization_and_destruction_0(int, int)':
> get_sys_info.cpp:(.text+0x13f): undefined reference to
> `boost::system::generic_category()'
> get_sys_info.cpp:(.text+0x14b): undefined reference to
> `boost::system::generic_category()'
> get_sys_info.cpp:(.text+0x157): undefined reference to
> `boost::system::system_category()'
> /tmp/cckONUUl.o: In function `boost::filesystem3::path::codecvt()':
> get_sys_info.cpp:(.text._ZN5boost11filesystem34path7codecvtEv[boost::filesystem3::path::codecvt()]+0x5):
> undefined reference to
> `boost::filesystem3::path::wchar_t_codecvt_facet()'
> collect2: ld returned 1 exit status
> make: *** [all] Error 1

-lboost_filesystem -lboost_system

> So, I am back to square one with the "undefined reference" compilation error.

Linking error, you mean.

> Can you please kindly suggest how can I resolve this problem? Thank you.

Volodya's blog post may help too

http://vladimir_prus.blogspot.co.uk/2009/06/linking-101.html

Best regards,

--
Mateusz Loskot, http://mateusz.loskot.net

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