In response to: http://lists.fedoraproject.org/pipermail/fedora-mingw/2008-November/000010.h...
b) poco is already prepared for cross-compilation to mingw (under cygwin)
MinGW and Cygwin are wholly separate and different things. Do not confuse them.
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/CppUnit/include -I/home/andrzej/poco/poco-1.3.3p1/Foundation/include -I/home/andrzej/poco/poco-1.3.3p1/XML/include -I/home/andrzej/poco/poco-1.3.3p1/Util/include -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 MinGW cross-compiler.
If that doesn't help, try reading my porting notes:
http://camltastic.blogspot.com/2008/10/mingw-compile-software-for-windows.ht...
(or maybe I'd better say, read them again, because I see you put a comment there already).
Rich.
On Sat, Nov 08, 2008 at 10:35:17AM +0000, Richard W.M. Jones wrote:
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 MinGW cross-compiler.
I had a closer look at Poco, and the problem is the latter: Poco have made the mistake of beliving that they can hand-roll a build system which is better than autoconf, and as with everyone who tries that they've ended up with something which is both worse and unfamiliar.
(Still, at least it's not as bad as what Boost did. Oh my, their hand-rolled build system is a tremendous example of fail).
This was my best shot at a patch for Poco 'economy' 1.3.3p1:
(a) Copy build/config/MinGW to build/config/MinGW-cross (b) Apply the attached patches, in order (c) ./configure --config=MinGW-cross (d) make
(This builds plausible-looking DLLs and binaries - I didn't test whether they worked.)
**Please submit the patches back** to Poco's upstream for inclusion in future releases.
Since Poco is a development tool / library under a free license, this is something that is suitable for inclusion in the Fedora MinGW project. You would need to get sponsored[1] if you aren't already, and submit a review request[2] for it. This way, we can share maintenance tasks for it, and you get a supported, up to date version in Fedora itself.
Rich.
[1] http://fedoraproject.org/wiki/PackageMaintainers/HowToGetSponsored [2] http://fedoraproject.org/wiki/PackageMaintainers/Join
Slightly better patch & working package in our dev repo here:
http://hg.et.redhat.com/misc/fedora-mingw--devel
However note that it's highly unlikely we will add this package to Fedora unless someone steps up to maintain it.
Rich.