Boost logo

Boost-Build :

Subject: Re: [Boost-build] g++ 4.3.2 linking error - auto-import
From: Juergen Hunold (juergen.hunold_at_[hidden])
Date: 2009-04-23 05:51:20


Hi Robert !

On Wednesday 22 April 2009, Robert Ramey wrote:
> I get the same problem when I build the serialization library with
> static linking. I suspect that the trunk tests don't do this so the
> problem only shows up when I do it myself. I would be happy to
> ignore the warning - EXCEPT that the program crashes with some sort
> of standard exception ? code 5 ?.

> >> This should work unless it involves constant data structures
> >> referencing symbols from auto-imported DLLs.)

Yes, it looks like that.

> From the message, it seemed that I
> would have to add something like decl or whatever to some of the
> declarations in the library, but I haven't been able to figure out
> which ones. So I'm stuck

Okay, I'm working on this one. The basic solution is to use
dllexport/dllimport for gcc on Windows, too.
I think this should be resolved together with:

https://svn.boost.org/trac/boost/ticket/2114

The idea is to let Boost.Config provide common export/import macros and
use them for uniform handling of the whole dll mess.
I'll attach the current patch for the whole boost.
Unfortunately, I'm missing the time to get this ready for 1.39.
And I'm stuck on some special cases Boost.Serialisation uses for
Borland. In boost/archive/detail/decl.hpp you use

             #if defined(__BORLANDC__)
             #define BOOST_ARCHIVE_DECL(T) T __export
             #define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) T __export
             #else

while boost/config/compiler/borland.hpp states at line 233 ff:

// all versions support __declspec:
//
#ifndef __STRICT_ANSI__
# define BOOST_HAS_DECLSPEC
#endif

and all other libraries simply use dllexport/-import.

The patch is locally testet under linux. Windows tests are pending...
I'll try to give this more love in the next time in order to get this
one fixed in 1.4.0

Yours,

Jürgen

-- 
* Dipl.-Math. Jürgen Hunold       ! Ingenieurgesellschaft für 
* voice: ++49 511 262926 57       ! Verkehrs- und Eisenbahnwesen mbH  
* fax  : ++49 511 262926 99       ! Lister Straße 15
* juergen.hunold_at_[hidden]        ! www.ivembh.de
* 
* Geschäftsführer:                ! Sitz des Unternehmens: Hannover
* Prof. Dr.-Ing. Thomas Siefer    ! Amtsgericht Hannover, HRB 56965
* PD Dr.-Ing. Alfons Radtke       !



Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk