Subject: Re: [boost] auto-link with gcc/windows
From: John Maddock (boost.regex_at_[hidden])
Date: 2010-07-06 13:03:11
> be a hint as to what the problem is. Still thanks for the insight.
>> If you got gcc-4.x around, the easiest solution would be to apply the
>> visibility patch and then compile with
>> "<cxxflags>>-fvisibility=hidden". You should then get the same linker
>> errors as mingw.
> That would seem to be the missing magic. I use cygwin with gcc 4.3.4
> to test here so I can try that. So I guess that the explanation of this
> instance might be that all the gcc compilers in the test matrix don't
> use -fvisibility=hidden while the MingW one does? and this couples
> with my usage of BOOST_HAS_DECL in some unexpected way?.
> anyway, I have something to work with for now.
Actually I don't think any will be using that flag right now.
My guess as to what's happening here is that one source file is seeing
symbol X with a __declspec(dllexport) attribute because
BOOST_SERIALIZATION_SOURCE is defined for that source, where as another
source file is seeing the same symbol without the __declspec() attribute
because BOOST_SERIALIZATION_SOURCE is not defined for it. The result is
that the two source files end up looking for different mangled names for
that symbol and hence the error. The most consistent way to deal with this
is to set BOOST_SERIALIZATION_SOURCE for all source the files.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk