Boost logo

Boost Users :

Subject: Re: [Boost-users] How do you compile Boost C++ code in Ubuntu?
From: Giovanni (giovanni.ong_at_[hidden])
Date: 2013-02-07 12:08:01


Greetings,
  I realized that when I installed certain packages from the Ubuntu
Software Center, I had broken some dependencies. That may have caused
the problem. Now, I have reinstalled Boost C++.

  See the following for a snippet from the Terminal session that
indicates the availability of the previously missing files.
Go Bears >ls -al | grep libboost_system
-rw-r--r-- 1 root root 48666 Jan 2 2012 libboost_system.a
lrwxrwxrwx 1 root root 17 Jan 2 2012
libboost_system-mt.a -> libboost_system.a
lrwxrwxrwx 1 root root 25 Jan 2 2012
libboost_system-mt.so -> libboost_system.so.1.46.1
lrwxrwxrwx 1 root root 25 Jan 2 2012 libboost_system.so
-> libboost_system.so.1.46.1
-rw-r--r-- 1 root root 14568 Jan 2 2012 libboost_system.so.1.46.1
Go Bears >
Go Bears >make all
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
Go Bears >

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

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

Regards

On Thu, Feb 7, 2013 at 8:33 AM, Mateusz Loskot <mateusz_at_[hidden]> wrote:
> On 7 February 2013 15:21, Giovanni <giovanni.ong_at_[hidden]> wrote:
>>
>> I had set the shell variable $LD_LIBRARY_PATH to:
>> /usr/lib/libboost_system.so. It was originally empty. I used the
>> "echo" command to reflect the path that I had set it to.
>
> I tried to make a point not about how you did set the variable,
> but about the fact it has incorrect value.
> Let me copy it once again:
>
> "LD_LIBRARY_PATH, which is a colon-separated list of directories" [1]
>
> [1] http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html
>
> And you may learn from that what the LD_LIBRARY_PATH is meant to be.
>
>> I had installed it with Ubuntu Software Center.
>> Here is a snippet of: /usr/lib
>> [...]
>> -rw-r--r-- 1 root root 14568 Jan 2 2012 libboost_system.so.1.46.1
>> -rw-r--r-- 1 root root 14568 Jan 5 2012 libboost_system.so.1.48.0
>
> You seem to be missing libboost_system.so library or symlink named
> libboost_system.so with one of the two as a target.
> It may look the installation is broken.
>
>> When I followed your instructions to install it (again), I couldn't.
>> Here is the transcript from the Terminal.
>> Go Bears >sudo apt-get install libboost-system-dev
>> [sudo] password for arvind:
>> Reading package lists... Done
>> Building dependency tree
>> Reading state information... Done
>> Some packages could not be installed. This may mean that you have
>> requested an impossible situation or if you are using the unstable
>> distribution that some required packages have not yet been created
>> or been moved out of Incoming.
>> The following information may help to resolve the situation:
>>
>> The following packages have unmet dependencies:
>> libboost-system-dev : Depends: libboost-system1.46-dev but it is not
>> going to be installed
>> E: Unable to correct problems, you have held broken packages.
>
> Clearly, something is broken with installation of boost packages in your system.
> You should seek for help from Ubuntu folks, it's unrelated to Boost.
>


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