<---- template headericclude ----->
Linking issues between boost and C++ libraries
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2011
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Linking issues between boost and C++ libraries

    I'm trying to compile a big CUDA C++ / Python code in Fedora 15 64-bit. CUDA doesn't support gcc 4.5 or newer, so I've installed gcc 4.4.6 in my /opt directory. After pointing cmake and nvcc to the old version of gcc, everything seems to compile fine, but then I get a big set of errors:

    Code:
    /usr/lib/../lib64/libboost_signals-mt.so: undefined reference to `std::__detail::_List_node_base::swap(std::__detail::_List_node_base&, std::__detail::_List_node_base&)@GLIBCXX_3.4.15'
    /usr/lib/../lib64/libboost_thread-mt.so: undefined reference to `std::out_of_range::~out_of_range()@GLIBCXX_3.4.15'
    /usr/lib/../lib64/libboost_signals-mt.so: undefined reference to `std::__detail::_List_node_base::_M_transfer(std::__detail::_List_node_base*, std::__detail::_List_node_base*)@GLIBCXX_3.4.15'
    /usr/lib/../lib64/libboost_signals-mt.so: undefined reference to `std::__detail::_List_node_base::_M_reverse()@GLIBCXX_3.4.15'
    /usr/lib/../lib64/libboost_signals-mt.so: undefined reference to `std::__detail::_List_node_base::_M_unhook()@GLIBCXX_3.4.15'
    /usr/lib/../lib64/libboost_python-mt.so: undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)@GLIBCXX_3.4.15'
    collect2: ld returned 1 exit status
    make[2]: *** [python-runner/hoomd] Error 1
    make[1]: *** [python-runner/CMakeFiles/hoomd.dir/all] Error 2
    make: *** [all] Error 2
    It looks like the boost library is trying to link to GLIBCXX_3.4.15, so I checked to see if it exists:

    Code:
    $ pwd
    /opt/gcc-4.4.6/lib64
    $ strings libstdc++.so.6 | grep GLIBC
    GLIBCXX_3.4
    GLIBCXX_3.4.1
    GLIBCXX_3.4.2
    GLIBCXX_3.4.3
    GLIBCXX_3.4.4
    GLIBCXX_3.4.5
    GLIBCXX_3.4.6
    GLIBCXX_3.4.7
    GLIBCXX_3.4.8
    GLIBCXX_3.4.9
    GLIBCXX_3.4.10
    GLIBCXX_3.4.11
    GLIBCXX_3.4.12
    GLIBCXX_3.4.13
    GLIBC_2.2.5
    GLIBC_2.3
    GLIBC_2.14
    GLIBC_2.3.2
    GLIBCXX_FORCE_NEW
    GLIBCXX_DEBUG_MESSAGE_LENGTH
    The conclusion I've reached is that boost is trying to link to a version of the C++ standard library that GCC 4.4.6 does not support. Is this correct? If so, how do I direct boost to an older library (3.4.13, for example)?

  2. #2
    Join Date
    Aug 2009
    Location
    Waldorf, Maryland
    Posts
    7,343
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Linking issues between boost and C++ libraries

    LD_LIBRARY_PATH should do the trick.

    I also believe the Makefile will have a library reference list and it could be modified to include -L /opt/lib<whatever> when it is linking.

  3. #3
    Join Date
    Aug 2011
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Linking issues between boost and C++ libraries

    OK, so I tried adding the library directories for gcc 4.4.6 to my LD_LIBRARY_PATH. I added this line to my .bashrc file:

    Code:
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/gcc-4.4.6/lib:/opt/gcc-4.4.6/lib64
    I then tried to compile again, and cmake gave me an error:

    Code:
    cmake: /opt/gcc-4.4.6/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by cmake)
    So then I added another line to my .bashrc file:

    Code:
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib:/usr/lib64
    and I got the same error. Finally, I commented out the first line that I added, and I got the same set of errors as in the OP.

    Would messing with the makefiles accomplish the same goal as adding those paths to my LD_LIBRARY_PATH? I'm not comfortable messing around with makefiles manually, so I'd rather avoid it if at all possible.

  4. #4
    Join Date
    Dec 2009
    Location
    Centennial, Colorado USA
    Posts
    128
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Linking issues between boost and C++ libraries

    Use "nm" on your .o files to see the external links. You will have to compile with debug option: -g on the command line. If you use "ldd <executable>" it will dump the needed libraries that need to be resolved at load time. "ldd <library>" will dump the other libraries that will be needed. (Go to /lib and run ldd on one of the .so libraries to see the output).

    Hope this helps.

  5. #5
    Join Date
    Aug 2011
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Linking issues between boost and C++ libraries

    My apologies, but ended up breaking my Fedora install and switching back to Mint, since I'm more comfortable with it. Sorry for wasting your time.

Similar Threads

  1. Linking to X development libraries in GTK+
    By vogelM4269 in forum Using Fedora
    Replies: 1
    Last Post: 17th October 2010, 05:43 PM
  2. [SOLVED]
    Boost libraries not found
    By Alex Farber in forum Using Fedora
    Replies: 2
    Last Post: 24th May 2010, 06:50 AM
  3. Boost linking
    By roelj in forum Programming & Packaging
    Replies: 9
    Last Post: 6th April 2010, 01:39 AM
  4. Linking 32-bit libraries
    By James Board in forum Programming & Packaging
    Replies: 2
    Last Post: 31st August 2008, 08:57 PM
  5. Boost C++ libraries out of date, who to contact?
    By iamscottevil in forum Using Fedora
    Replies: 5
    Last Post: 24th September 2007, 02:32 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
[[template footer(Guest)]]