Boost logo

Boost :

From: Ralf W. Grosse-Kunstleve (rwgk_at_[hidden])
Date: 2002-10-11 15:49:32


--- Peter Dimov <pdimov_at_[hidden]> wrote:
> From: "Ralf W. Grosse-Kunstleve" <rwgk_at_[hidden]>
> > I am a heavy user of the Boost.Python library on a variety of
> > platforms. Recently I started getting strange "unresolved symbol"
> > warnings from the Compaq Tru64 cxx linker, followed by "unresolved
> > symbol" run-time errors from dlopen(). For example:
> >
> > ld:
> > Warning: Unresolved:
> > <unnamed namespace>::_1
> > <unnamed namespace>::_2
> >
> > ImportError: dlopen: wavelengths.so: symbol
> "__7_2__24__N1symbols_cpp_0155a56e"
> > unresolved
> >
> > Since the exact same code works on several other platforms (Unices and
> > Windows) I thought this must be a linker bug. Therefore I sent a bug
> > report to Compaq c/c++ compiler team. They quickly responded and
> > actively investigated the problem. After some back and forth they just
> > sent me this message:
> >
> > > _1 is defined in boost/boost/bind/placeholders.hpp.
> > >
> > > I'm guessing that either this should be made static or it should be
> > > made extern and the definition should be put in a .cpp file.
> >
> > I am lost here. Could someone please advise?
>
> Their response isn't of much help. :-)
>
> The problem you are experiencing is likely caused by a "broken" precompiled
> header implementation that doesn't handle variable definitions in an unnamed
> namespace. Borland C++ and MSVC 6 have the same problem; look at
> placeholders.hpp and try the alternate paths, perhaps one of them will work
> for Compaq.

But your response is /very/ helpful: The tiny patch below eliminates the linker
problems! (This is much less drastic then what Compaq suggested as a
workaround.)

Is there any chance this could still make it into the 1.29.0 tar file?

Ralf

Index: placeholders.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/bind/placeholders.hpp,v
retrieving revision 1.7
diff -r1.7 placeholders.hpp
39c39,40
< #elif defined(BOOST_MSVC) && BOOST_MSVC <= 1300

---
> #elif defined(BOOST_MSVC) && BOOST_MSVC <= 1300 \
>    || (defined(__DECCXX_VER) && __DECCXX_VER <= 60590031)
__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk