std library - poco compilation problem mingw - fedora10
Richard W.M. Jones
rjones at redhat.com
Sat Nov 8 10:35:17 UTC 2008
In response to:
> b) poco is already prepared for cross-compilation to mingw (under
MinGW and Cygwin are wholly separate and different things. Do not
MinGW is just a compiler and some Win32 header files. Cross-
compilation using MinGW (which is what the Fedora MinGW project is all
about) uses Win32 API calls, and so Unix programs require significant
porting efforts to work. eg. If your Unix program calls 'fork(2)',
then forget it - it's never going to work under Win32 API until that
dependency is removed or replaced.
Cygwin is, essentially, a Unix emulator for Windows. Unix programs
can usually be compiled directly for Cygwin with no changes, because
Cygwin offers the familiar Unix/POSIX API to programs (by emulating it
at great cost, including features like 'fork' which are not found on
Windows and expensive to emulate).
Cygwin has fatal licensing problems which prevent commercial use,
apart from being inefficient, which is why we didn't go that route.
So back to your program ...
> i686-pc-mingw32-g++ -Iinclude
> -I/home/andrzej/poco/poco-1.3.3p1/Net/include -DPOCO_BUILD_HOST=linx
> -v -mno-cygwin -D_WIN32 -DMINGW32 -DWINVER=0x500
> -DPOCO_NO_FPENVIRONMENT -DPCRE_STATIC -DPOCO_THREAD_STACK_SIZE
> -DFoundation_Config_INCLUDED -I/usr/local/include -I/usr/include
This is your problem - the cross-compilers that we ship are configured
so they never look in /usr/include or /usr/local/include. Header
files in /usr/include are for the build system (Fedora), and are wrong
for the host system (Windows). If you specifically add /usr/include
and /usr/local/include back in, then you'll pick up the wrong headers,
and anything can go wrong from there.
I gather that you didn't write Poco's build system, but you need to go
back and find out why it's including this. Probably (as demonstrated
by the MinGW / Cygwin confusion above), Poco either hasn't been ported
to MinGW, or needs some different options to compile under a true
If that doesn't help, try reading my porting notes:
(or maybe I'd better say, read them again, because I see you put a
comment there already).
Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones
Read my OCaml programming blog: http://camltastic.blogspot.com/
Fedora now supports 68 OCaml packages (the OPEN alternative to F#)
More information about the mingw