Errror building libdivecomputer
Jef Driesen
jefdriesen at telenet.be
Mon Sep 10 05:45:07 PDT 2012
On 2012-09-10 13:42, Ivan Habunek wrote:
> I'm now trying to build windows binaries using mingw. Not too
> successfully. :)
In case it helps, the setup I'm using to cross-compile the Windows
binaries for the libdivecomputer project are as follows:
1. Install the mingw32 cross compiler:
sudo apt-get install mingw32
2. Setup a development environment with Windows version of all the
libraries that are not included in the mingw package. I use the
directory "/opt/i586-mingw32msvc/".
For usb support, you'll need the libusb headers and library. For IrDA
support, you'll need the af_irda.h header file. I don't remember exactly
where I got that file from, but the header says it part of the mingw
package. For building gtk+ applications, like subsurface, you'll also
need the gtk+ headers and libraries. I used the all-in-one bundle [1].
After untarring, you should end-up with a directory structure like
this:
/opt/i586-mingw32msvc/bin/
/opt/i586-mingw32msvc/include/
/opt/i586-mingw32msvc/lib/
/opt/i586-mingw32msvc/lib/pkgconfig/
...
2. Build libdivecomputer:
./configure --host=i586-mingw32msvc --prefix=$HOME/local
PKG_CONFIG_LIBDIR='/opt/i586-mingw32msvc/lib/pkgconfig'
The PKG_CONFIG_LIBDIR variable is to force pkg-config to search in our
windows directory. Otherwise it will try to use the native linux
packages, which obviously won't work. Note that it's fine to use the
native linux pkg-config binary, but not its default search path!
Of course the prefix can be changed to your preference too. I prefer to
use a subdirectory in my home directory, because then I don't need any
special permissions to install. In fact, I could have used the same
directory for everything, instead of the extra /opt/i586-mingw32msvc
directory, but that's just a leftover from long time ago :-)
Now you can just build as usual:
make
make install
[1] http://www.gtk.org/download/win32.php
Jef
More information about the subsurface
mailing list