Home » Developing U++ » U++ Developers corner » Cross compiling with mingw
Cross compiling with mingw [message #46269] |
Mon, 04 April 2016 21:14 |
tomas
Messages: 6 Registered: February 2016
|
Promising Member |
|
|
Hi.
I have been experimenting a bit with cross compiling the examples using mingw under linux.
It works quite well but I have run in to some issues. I saw a recent post from Novo who also had similar experiences.
1) Header files
The mingw Windows header files are all named in lower case.
This is ok on Windows since Windows in most cases is case insensitive but most linux file systems are case sensitive which means that:
#include <ShellApi.h>
won't work since the mingw file is named shellapi.h
The simplest solution would be to use lower case names when including Windows headers, this should work on both linux and Windows with both mingw and Visual Studio.
I have been poking around in the Qt sources and lower case windows includes seems how they are doing it also:
http:// code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/global/qt_win dows.h
http:// code.qt.io/cgit/qt/qtbase.git/tree/src/network/kernel/qnetwo rkinterface_win.cpp
2) flagWIN32
This flag does not get set when using mingw on linux resulting in problems when including png.h for instance.
Adding the flag to the "Common options" in the build configuration solves the problem for now.
3) Linking
The build system gets a bit confused and tries to use the linux libraries instead of the Windows ones when cross compiling with mingw.
Best regards
Tomas
|
|
|
Goto Forum:
Current Time: Sat Apr 26 13:09:28 CEST 2025
Total time taken to generate the page: 0.01350 seconds
|