Boost logo

Boost Users :

Subject: Re: [Boost-users] Linker error when using Boot regex on AIX
From: Stian Zeljko Vrba (vrba_at_[hidden])
Date: 2017-09-18 11:21:34


Does the complete error message mention which object file references the undefined symbol?

Could you turn up verbosity of the linker?

Also, static linking is usually one-pass, so the order in which libraries are given to the linker matters. When there are circular dependencies between static libraries, some of them have to be specified TWICE to the linker.

Why do you link statically to boost? Does it work when you remove -Bstatic/-Bdynamic options?

________________________________
From: Jyoti Sharma <jyoti.mickey_at_[hidden]>
Sent: Monday, September 18, 2017 12:15:35 PM
To: Stian Zeljko Vrba
Cc: boost-users_at_[hidden]
Subject: Re: [Boost-users] Linker error when using Boot regex on AIX

Thanks for the response.

The platform is 64 bit powerpc aix 6.1. Entire project is 64-bit and is built in one go.

I made mistake in emailing the details by hand, here is the copy paste:
machine:/home>nm -X64 libboost_regex.a | grep do_assign
._ZN5boost11basic_regexIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE9do_assignEPKcS7_j T 189268
..
..

On Fri, Sep 15, 2017 at 8:09 PM, Stian Zeljko Vrba <vrba_at_[hidden]<mailto:vrba_at_[hidden]>> wrote:

You didn't write anything about your platform, but a wild guess: bitness-mismatch; e.g., trying to link a 32-bit object file with a 64-bit library.

Also, you're running nm on the wrong files to check for symbols. If you're linking statically, you should run nm on the .a files, not on the .so files.

________________________________
From: Boost-users <boost-users-bounces_at_[hidden]<mailto:boost-users-bounces_at_[hidden]>> on behalf of Jyoti Sharma via Boost-users <boost-users_at_[hidden]<mailto:boost-users_at_[hidden]>>
Sent: Friday, September 15, 2017 12:10:25 PM
To: boost-users_at_[hidden]<mailto:boost-users_at_[hidden]>
Cc: Jyoti Sharma
Subject: [Boost-users] Linker error when using Boot regex on AIX

I am using boost_1_61_0. In my code I have:

#include <boost/regex.hpp>
static boost::regex testxp("[");

I have these libraries:
    libboost_regex.a libboost_regex.so

I can see these libraries have symbols:
    LIBRARY: Shared object libboost_regex.so: 136 symbols imported.
    LIBRARY: Shared object libboost_system.so: 7 symbols imported.

To build my program I have added these linking options:
    -Wl,-bnoquiet -Wl,-Bstatic -lboost_regex -lboost_system -Wl,-Bdynamic

But I get this error during linking:
    ld: 0711-317 ERROR: Undefined symbol: .boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::do_assign(char const*, char const*, unsigned int)

But that symbol is there:
machine:/home> nm libboost_regex.so nm libboost_regex.so |grep do_assign
._ZN5boost11basic_regexIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE9do_assignEPKcS7_j T 268508592
machine:/home> c++filt ._ZN5boost11basic_regexIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE9do_assignEPKcS7_j
.boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::do_assign(char const*, char const*, unsigned int)



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