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-22 02:16:04


Hi Frédéric,

On Tuesday 21 April 2009, Frédéric Bron wrote:
> What does this error mean? http://tinyurl.com/dgrw8t
> It does not appear with g++ 3.4.4, only with 4.3.2.

This is a new feature of gcc-4.x, I think. It allows linking against
dll without dllexport/dllimport attributes.

The relevant part of the error message is:
> (auto-import/usr/lib/gcc/i686-pc-cygwin/4.3.2/../../../../i686-pc-cyg
>win/bin/ld: warning: auto-importing has been activated without
> --enable-auto-import specified on the command line.
> This should work unless it involves constant data structures
> referencing symbols from auto-imported DLLs.)

This can be fixed by adding:
    
    <linkflags>-Wl,--enable-auto-import

to the compiler setup.
I also add

     <linkflags>-Wl,--enable-stdcall-fixup

to prevent further warning from gcc-4.x
For further information, take a look at the gcc documentation.
I'm no cygwin/mingw expert, most options are shamelessly copied from
Qt's win32-g++ mkspecs and work here (tm). :-))

You might also hit

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

when running Boost.Test based tests with gcc-4.x .

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