# Notes on Cross-Compiling to MinGW32

Compile and install OpenOBEX for win32 target

export CC=/opt/xmingw/bin/i386-mingw32msvc-gcc export PATH=/opt/xmingw/bin:/opt/xmingw/i386-mingw32msvc/bin:$PATH ./configure --host=i386-mingw32msvc --build=i686-pc-linux-gnu or ./configure --host=i386-mingw32msvc ; make

(modify openobex-config to have the right paths)

Compile ObexFTP using the additional libwsock32.a from w32api-2.0.

export PATH=/usr/local/cross-tools/bin:/usr/local/cross-tools/i386-mingw32msvc/bin:$PATH CFLAGS='-Werror -I/usr/local/cross-tools/i386-mingw32msvc/include' ./configure --build i686-suse-linux --host i386-mingw32msvc

Needed Libs:
glib-1.3.dll (ONLY for openobex/obexftp 0.9.x) libopenobex.a
libwsock32.a
getopt.o

#include <winsock.h> // before obex.h

Changes for openobex-0.9.8

./src/obex_main.h

- void DEBUG(unsigned int n, ...); + #define DEBUG(n, args...) if (obex_debug >= (n)) g_print(args)

    --- ./src/obex.c~       Tue Feb 27 15:24:14 2001
    +++ ./src/obex.c        Wed Nov 13 20:23:26 2002

@@ -378 +378 @@

    -       g_return_val_if_fail(saddr != NULL, -1);
    +       g_return_val_if_fail((addrlen==0) || (saddr != NULL), -1);

    --- ./src/obex_header.h~        Fri Dec  1 14:21:16 2000

+++ ./src/obex_header.h Wed Nov 13 19:25:19 2002 @@ -42,0 +43 @@
+#ifndef PACKED
@@ -43,0 +45 @@
+#endif