User forums > Using Code::Blocks
Howto - Cross Compiling in Linux using MingW32
Jenna:
--- Quote from: Ganbito on August 16, 2008, 12:45:52 pm ---... it can be because my system is not Debian, but Debian-based (Ubuntu).
--- End quote ---
I just did a quick diff between hardys and feistys contents and the contents of the debian packages (all from apt.wxwidgets.org), but there seem to be no differences in directory-structure, the only differences are in examples and some python-wx packages.
Ganbito:
I give another try to your binaries. This time I set:
Compiler settings -> Other options
--- Code: ---`wx-config --prefix=/usr/i586-mingw32msvc --host=i586-mingw32msvc --static` -U__WXGTK__ -U__WXGTK20__
--- End code ---
Linker Settings -> Other options
--- Code: ---`wx-config --prefix=/usr/i586-mingw32msvc --host=i586-mingw32msvc --static`
--- End code ---
Search directories->Compiler and ->Linker:
--- Code: ---/usr/i586-mingw32msvc/include/wx-2.8
--- End code ---
I also have to modify /usr/include/wx-2.8/wx/platform.h line 196 from this:
--- Code: ---#include "wx/setup.h"
--- End code ---
to this:
--- Code: ---#ifdef __WXGTK__
# include "wx/setup.h"
#endif
#ifdef __WIN32__
# include "wx/msw/setup0.h"
#endif
--- End code ---
If I don't do that I get this error: "wxClipboard requires wxDataObject". Both are enabled, but without including "msw/setup0.h" the "wxUSE_DATAOBJ" needed remains 0 when it has to be 1.
With this, when I build the Windows target I get a few warnings and this error:
--- Code: ---ld | | cannot find -lwx_gtk2u_richtext-2.8
||=== Build finished: 1 errors, 9 warnings ===|
--- End code ---
With the warnings, it compile and run under windows, but no with that error.
And... that option? come from Code::Blocks? and why?
This time I attach the sample project and "default.conf".
[attachment deleted by admin]
Jenna:
The first (and major error):
--- Quote --- * In the Build options of the project you have to move `wx-config --cflags` from the global Compiler settings -> Other options to the one for the standard build targets (Debug and Release).
Do the same for Linker Settings -> Other options.
* To make it clear the Other options-tabs of the Compiler settings and Linker settings belonging to the whole project have to be empty (or only include settings that are valid for the Linux and the MS Windows targets).
--- End quote ---
(quote from:http://wiki.codeblocks.org/index.php?title=Cross_Compiling_wxWidgets_Applications_on_Linux#Fixing_build_options)
The second error:
you missed the "--cflags" for compiler-settings and the "--libs" for linker settings from your "wx-config"-line.
see screenshot in the wiki:
If these errors are corrected I can build the project without errors.
I think, I will include the full line for wx-config in the wiki (not only the screenshots) to make it a little bit more clear.
Ganbito:
The first error:
My global Compiler settings -> Other options and Settings -> Other options are empty so I have nothing to "move" as you write in your wiki-article, so thats the reason that I have no `wx-config --cflags` on my project build options.
The second error:
For the cross-compiler target, I haven't noticed the images in the wiki (so little) and I use the text only, so that's my fault.
I've just set the right options "--cflags" and "--libs" but I obtain the same as before:
-If I don't modify "platform.h": error: wxClipboard requires wxDataObject.
-If I don't add -U__WXGTK__ to project's Compiler settings->Other options: /usr/include/wx-2.8/wx/defs.h | 2820 | error: conflicting declaration ‘typedef struct GtkWidget* WXWidget’.
-If I add it: ld | | cannot find -lwx_gtk2u_richtext-2.8.
Jenna:
--- Quote from: Ganbito on August 16, 2008, 05:13:34 pm ---The first error:
My global Compiler settings -> Other options and Settings -> Other options are empty so I have nothing to "move" as you write in your wiki-article, so thats the reason that I have no `wx-config --cflags` on my project build options.
--- End quote ---
Here again: In the Build options of the project you have to move `wx-config --cflags` from the global Compiler settings -> Other options to the one for the standard build targets (Debug and Release).
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version