[odb-users] ODB on MinGW

Boris Kolpackov boris at codesynthesis.com
Fri May 20 11:07:08 EDT 2011


Hi Uwe,

[I'am CC'ing the odb-users mailing list to this portion of my reply in
 case others have a similar question.]

cetoni GmbH - Uwe Kindler <uwe.kindler at cetoni.de> writes:

> Compiling the ODB libraries with MinGW was not that easy but I managed  
> to get working libraries. We use ODB with Sqlite. MinGW prints some  
> warnings because of auto imported symbols. Normally if you compile  
> windows DLLs you need to export symbols via _declspec(dllexport) like  
> you do it via LIBODB_EXPORT macro. But for MinGW builds it is easier to  
> rely on the -enable-auto-import and -export-all-symbols features. That  
> means for MinGW builds these two options should get added to the  
> compiler/linker options.

Actually we test every release of ODB with MinGW and all ODB libraries
are MinGW-aware and properly export the necessary symbols, just like
when built with VC++. The advantage of this approach compared to using
--export-all-symbols is that the libraries are smaller. We still use the
--enable-auto-import in order to get rid of warnings when linking to
libstdc++ which doesn't export the symbols explicitly.

So the configure command like that we use for building on MinGW is this:

./configure LDFLAGS="-Wl,--enable-auto-import"

And as far as I know the build is warning-free.

Boris



More information about the odb-users mailing list