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 09:18:18


On 7 February 2013 10:06, Giovanni <giovanni.ong_at_[hidden]> wrote:
> Greetings,
> I cannot compile my Boost C++ code.

Do you mean Boost C++ code, thus building Boost libraries,
or you mean your code that *uses* Boost libraries? Unclear.

> Initially, it complains of “undefined reference”. When I try to
> resolve this by including the library, I get the "/usr/bin/ld: cannot
> find -lboost_system" error.

So, looks like the former, you are trying to use the libraries.

> From the Terminal:
> Go Bears >echo $LD_LIBRARY_PATH
> /usr/lib/libboost_system.so

Where do you get this from?

"LD_LIBRARY_PATH, which is a colon-separated list of directories" [1]

[1] http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html

> Go Bears >make all
> g++ -L/usr/lib -lboost_system get_sys_info.cpp

Have you installed it first?

sudo apt-get install libboost-system-dev

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