Hi Andreas & all,
I downloaded exiv2 v0.18 and I wanted to build a dll in windows using
MinGW/msys.
I'd like to share my results, hoping that someone more fluent in
autotools & company would be able to spot my errors or make the
process more "streamlined".
here's some packages I have installed:
gcc-core-4.2.1-sjlj-2
gcc-g++-4.2.1-sjlj-2
w32api-3.10
binutils-2.17.50-20060824-1
mingw32-make-3.81-2
mingw-runtime-3.13
So I opened an msys shell and configured exiv2 with:
./configure --disable-xmp --disable-visibility
It seems like I have to use --disable-visibility to avoid warning
messages (output by g++) like these:
warning: visibility attribute not supported in this configuration; ignored
Are gcc's visibility attributes an ELF exclusive or are those
available also for PE targets?
My g++ was built like this:
$ g++ -v
Using built-in specs.
Target: mingw32
Configured with: ../gcc-4.2.1-2-src/configure --with-gcc
--enable-libgomp --host=mingw32 --build=mingw32 --target=mingw32
--program-suffix=-sjlj --with-arch=i486 --with-tune=generic
--disable-werror --prefix=/mingw --with-local-prefix=/mingw
--enable-threads --disable-nls
--enable-languages=c,c++,fortran,objc,obj-c++,ada
--disable-win32-registry --enable-sjlj-exceptions
--enable-libstdcxx-debug --enable-cxx-flags=-fno-function-sections
-fno-data-sections --enable-version-specific-runtime-libs
--disable-bootstrap
Thread model: win32
gcc version 4.2.1-sjlj (mingw32-2)
I then built exiv2 with:
make LDFLAGS="-no-undefined -L/usr/local/lib"
the -no-undefined switch was required so that libtool would be able to
build the dll. Without it libtool complains with:
libtool: link: warning: undefined symbols not allowed in
i686-pc-mingw32 shared libraries
and builds only the static lib of exiv2.
the -L/usr/local/lib switch was required because otherwise libtool
wasn't able to find the libraries for libz (aka zlib): in
C:\msys\1.0\local\lib (mounted in /usr/local/lib) I have the following
files from the GnuWin32 package of zlib:
libz.a
libz.dll (renamed from the zlib1.dll)
libz.dll.a
The build process completes and I have a working libexiv2-5.dll file
which I am able to link against.
Why does libtool appends -5 btw?
happy new year to y'all
Giuseppe