Author Topic: Serious setup.h woes - cross-compiling Linux->Windows  (Read 5376 times)

Offline Karmas_Nomad

  • Single posting newcomer
  • *
  • Posts: 2
Serious setup.h woes - cross-compiling Linux->Windows
« on: May 24, 2010, 03:16:16 pm »
Hi,

As per the title, I'm having serious problems with setup.h. I'm using Ubuntu 9.10, and attempting to cross-compile for Windows. I've followed Jens' fantastically helpful and thorough guide on the codeblocks wiki, but it almost feels as if there is a key detail missing  :?

So far, I've installed codeblocks, mingw32 and libwxgtk2.8-dev (and all dependencies) from the ubuntu repos, as well as following the wxwidgets cross-build section of the guide to enable cross-compiling (right..?). I've followed the rest of the guide to the letter, using the default "Welcome to wxWidgets" app. But although the linux build compiles just fine, the windows version throws up a poop-ton of errors, all seeming to stem from the inability to find "wx/setup.h". Here is the output I'm getting:
Code
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/platform.h|196|error: wx/setup.h: No such file or directory|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|103|error: #error "wxUSE_DYNLIB_CLASS must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|111|error: #error "wxUSE_EXCEPTIONS must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|119|error: #error "wxUSE_FILESYSTEM must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|127|error: #error "wxUSE_FS_ARCHIVE must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|140|error: #error "wxUSE_DYNAMIC_LOADER must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|148|error: #error "wxUSE_LOG must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|156|error: #error "wxUSE_LONGLONG must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|164|error: #error "wxUSE_MIMETYPE must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|180|error: #error "wxUSE_PRINTF_POS_PARAMS must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|188|error: #error "wxUSE_PROTOCOL must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|230|error: #error "wxUSE_REGEX must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|238|error: #error "wxUSE_STDPATHS must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|246|error: #error "wxUSE_XML must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|254|error: #error "wxUSE_SOCKETS must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|262|error: #error "wxUSE_STREAMS must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|270|error: #error "wxUSE_STOPWATCH must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|278|error: #error "wxUSE_TEXTBUFFER must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|286|error: #error "wxUSE_TEXTFILE must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|302|error: #error "wxUSE_URL must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|310|error: #error "wxUSE_VARIANT must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|330|error: #error "wxUSE_ABOUTDLG must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|338|error: #error "wxUSE_ACCEL must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|346|error: #error "wxUSE_ANIMATIONCTRL must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|354|error: #error "wxUSE_BITMAPCOMBOBOX must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|362|error: #error "wxUSE_BMPBUTTON must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|370|error: #error "wxUSE_BUTTON must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|378|error: #error "wxUSE_CALENDARCTRL must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|386|error: #error "wxUSE_CARET must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|394|error: #error "wxUSE_CHECKBOX must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|410|error: #error "wxUSE_CHOICE must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|418|error: #error "wxUSE_CHOICEBOOK must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|426|error: #error "wxUSE_CHOICEDLG must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|434|error: #error "wxUSE_CLIPBOARD must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|442|error: #error "wxUSE_COLLPANE must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|450|error: #error "wxUSE_COLOURDLG must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|458|error: #error "wxUSE_COLOURPICKERCTRL must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|466|error: #error "wxUSE_COMBOBOX must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|474|error: #error "wxUSE_COMBOCTRL must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|482|error: #error "wxUSE_DATAOBJ must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|490|error: #error "wxUSE_DATAVIEWCTRL must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|498|error: #error "wxUSE_DATEPICKCTRL must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|506|error: #error "wxUSE_DIRPICKERCTRL must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|514|error: #error "wxUSE_DISPLAY must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|522|error: #error "wxUSE_DOC_VIEW_ARCHITECTURE must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|530|error: #error "wxUSE_FILEDLG must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|538|error: #error "wxUSE_FILEPICKERCTRL must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|546|error: #error "wxUSE_FONTDLG must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|554|error: #error "wxUSE_FONTMAP must be defined."|
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wx/chkconf.h|562|error: #error "wxUSE_FONTPICKERCTRL must be defined."|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 0 warnings ===|

A morning of googling has informed me that I'm hardly alone, but hasn't helped beyond that. I think I understand that there are different versions of setup.h for different target platforms, and that one should have been created and copied into place when I built wxwidgets. What I don't get is where it was meant to end up, and why codeblocks can't find it.

Please help, this is driving me mad!
And let me know if you need any more details.

Cheers,
Mark
« Last Edit: May 24, 2010, 03:18:11 pm by Karmas_Nomad »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Serious setup.h woes - cross-compiling Linux->Windows
« Reply #1 on: May 24, 2010, 04:02:19 pm »
I've never seen anyone seriously cross-compiling wxWidgets apps under Linux for Windows, but here are my 2 cents:

When you install wx for GTK this is pre-compiled for Linux, not for Windows. So: You cannot cross-compile apps for Windows with this. Usually you need either a pre-compiled version of wxWidgets for Windows or you compile it yourself. Did you do that with the cross compiler using the command line as used on Windows? Because if so and if all compiler options and environment variables are set for the Windows platform this should work and all include files should be found. Please verify that the files are being created correctly. Then please check the command line your are using to compile your wx Hello Workd app and post it here. The file "wx/setup.h" is usually NOT where the default wx widgets include files are, but requires to provide an additional include folder to the comppiler (for me it is $(#WX.lib)\gcc_dll$(WX_CFG)\msw$(WX_SUFFIX) in C::B's syntax, where the # variables depend on version and the setup you've used for the compilation of wxWidgets - it resolves e.g. to [wxWidgets]\lib\gcc_dll\mswu).

BTW: It may be by far easier to use a virtualisation software for that purpose. Compiling in a virtual Windows is definitely easier than cross-compiling on Linux. Especially if you think about things like debugging or alike. I am pretty sure that this will hit you sooner or later. I do it the other way round: Having a virtualised Linux on a Windows host. This always worked to any extend, including debugging, testing and packaging.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Serious setup.h woes - cross-compiling Linux->Windows
« Reply #2 on: May 24, 2010, 04:24:35 pm »
I've never seen anyone seriously cross-compiling wxWidgets apps under Linux for Windows, but here are my 2 cents:

I don't do so, but I provide wxWidgets packages to do so on my server.
And it works flawlessly, if the apps are linked statically, it also works otherwise, but using the apps on windows is somewhat harder.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Serious setup.h woes - cross-compiling Linux->Windows
« Reply #3 on: May 24, 2010, 04:34:48 pm »
By the way, you most likely can not use the sources from ubuntu, to b uild the wxWidgets cross-libs, because they might miss the msw-part (at least the debian sources don't have it), you have to use the sources from wxWidgets.org or use the patched sources from my server.

But I suggest to use my packages.
If they don't install, because of dependencies and you have wxwidgets 2.8.10, you can use the wx2.8-headers-msw-force-depends from my repo.
« Last Edit: May 24, 2010, 04:36:53 pm by jens »

Offline Karmas_Nomad

  • Single posting newcomer
  • *
  • Posts: 2
Re: Serious setup.h woes - cross-compiling Linux->Windows
« Reply #4 on: May 25, 2010, 12:19:06 pm »
Thanks guys, I managed to sort it. In the end, I removed the wxmsw I had compiled myself, and installed the ones from jens' server. All is well now :)