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?
> 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:

to the compiler setup.
I also add


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

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



* 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]        !
* 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, david.abrahams at, gregod at, cpdaniel at, john at