User forums > Using Code::Blocks
Howto - Cross Compiling in Linux using MingW32
Jenna:
All the "wx-config"-stuff is only needed if you cross-compile with wxWidgets, it's not needed for pure console or win32-apps. If you want to use the latter, just copy a wizard-created win32-gui project from a win-box to your linux-box (you might have to fix something in properties or build options, Im not sure about that at the moment).
If you do so just start with the wxwidgets-wizard as I do in my example in the wiki.
And you need the cross-build-libs for wxWidgets, that I provide on my server. You can of course try to compile them yourself, but mine should work out of the box, if you have wxWidgets-2.8.8 installed.
You might need to install the "wx2.8-headers-msw-force-depends", if you get errors, because the "wx2.8-headers"-version from your distro, or from wxwidgets.org does not match the exact version of my "wx2.8-headers-msw".
Ganbito:
I'm using wxWidgets on my application, so I need to cross compile with it.
I've created a new wxWidgets project with the wizard as you do in the wiki.
I've picked "libwxmws2.8dbg", "libwxmsw2.8dev", "wx2.8headers-msw" and "wx2.8-headers-msw-force-depends" from your repository.
I just take a look on synaptic and your wxMSW is 2.8.8.0 and my wxWidgets is 2.8.8.1 (from wxWidgets repository) so this can be the problem, as you write.
Then I try to compile wxWidgets myself with the ./configure of your wiki and obtain this:
--- Code: ---Configured wxWidgets 2.8.8 for `i586-pc-mingw32msvc'
Which GUI toolkit should wxWidgets use? msw
Should wxWidgets be compiled into single library? no
Should wxWidgets be compiled in debug mode? no
Should wxWidgets be linked as a shared library? no
Should wxWidgets be compiled in Unicode mode? yes
What level of wxWidgets compatibility should be enabled?
wxWidgets 2.4 no
wxWidgets 2.6 yes
Which libraries should wxWidgets use?
jpeg builtin
png builtin
regex builtin
tiff builtin
zlib builtin
odbc no
expat builtin
libmspack no
sdl no
--- End code ---
Why mine should not compile as a single library?
Well, I go to try it.
Jenna:
--- Quote from: Ganbito on August 10, 2008, 03:52:46 pm ---Why mine should not compile as a single library?
--- End quote ---
I also do not use monolithic libs for my .deb's.
It was just an example-output in the wiki, but I just corrected it to show the output you get with the "./configure"-line I used as example to avoid misunderstandings.
The changes between 2.8.8.0 and 2.8.8.1 do not touch msw-builds afaik. But I will update my repo anyway to keep the version-numbering consistent.
EDIT (2.):
wxwidgets.org does not provide sources for 2.8.8.1 with msw build-tree included, that means I would have to merge it manually, but that's a little too much work, if it's only done to keep the version-number in sync.
EDIT:
Btw: the cross-libs only depend on the "wx2.8-headers"-package, so a change to source-code for linux (except for the headerfiles perhaps) can not harm the msw-cross-libraries.
Ganbito:
I agree with you that it is a little too much work. However, as I am going to need it, I give it another chance.
I started using wxWidgets 2.8.8.1 from wxWidgets repo and wxMSW 2.8.8.0 from your repo, I've configured Code::Blocks as your wiki-article says, using `wx-config --prefix=/usr/i586-mingw32msvc --host=i586-mingw32msvc --static` in Compiler settings -> Other options of the Windows build target.
I found lots of errors, mostly in wx header files, saying that it can find include file /usr/include/wx-2.8/wx/msw/include-file.h and I thinked about fix all manually, but I was lazy so I finally compile wxMSW with the following options:
--- Code: ---./configure --host=i586-mingw32msvc --enable-unicode --build=`./config.guess` --disable-shared
--- End code ---
That is, yours without --prefix (it installs to /usr/local) and it get to work, only a few warnings, but it compiles and runs in Windows XP. I also add the flags to compiling and linking options for the MinGW32 compiler as suggested by http://wiki.wxwidgets.org/Cross-Compiling_Under_Linux but it seems that they are not necessary.
Then, I try cross compiling my own project and I get problems with wxPropertyGrid (the same which Code::Blocks use) for the cross build, but that is already another story.
Jenna:
Did you run "wx-config --list" before compiling everything new.
Are you sure everything was setup correctly and that there are not rests of former tries to compile wxWidgets on your own ?
About wxPropertyGrid:
wxPropertyGRid is not part of wxWidgets.
It's a standalone-project ( http://wxpropgrid.sourceforge.net/cgi-bin/index ).
I don't know how to set it up for cross-compiling.
Sorry.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version