News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Howto - Cross Compiling in Linux using MingW32

Started by visualphoenix, June 16, 2006, 01:52:25 AM

Previous topic - Next topic

koen

Quote from: Pecan on November 18, 2006, 07:35:30 PM
Quote from: koen on November 18, 2006, 07:28:28 PM
After installing MingW32, how do I proceed to install the required wxWidgets header files, so I can compile wxWidgets projects? I think I'm just a bit lost on where to put the files. Did anyone manage to do this and is he/she willing to share some information?
Read Topic:
Installing Code::Blocks from source on Windows or Linux or Fedora or ....

I browsed through those pages, but I couldn't find what I was looking for. Maybe my problem statement wasn't clear enough. Let me try to elaborate:

I have installed C::B on Linux and I am able to compile/build/run wxWidgets projects on Linux. Now I would like to cross-compile my program to Windows. As far as I understand, I need MingW32 to do the actual cross-compilations, so I installed that first. However, when I try to cross-compile my program, I get errors because wxWidgets-msw files are missing (the first one it complains about is wx/msw/chkconf.h), which makes sense. So I guess I have to install those, but I'm not sure where to put them or what would be the best way to do this.

The page you sent me to seems to be about installing C::B itself, but I've already got that running (on Linux).

Pecan

Sorry that I misunderstood.

I am unaware that wxWidgets for windows can be installed on Linux and then used to compile a windows pgm.

Maybe someone familiar with Wine or some such can help.

koen

Quote from: Pecan on November 18, 2006, 11:47:39 PM
Sorry that I misunderstood.
I am unaware that wxWidgets for windows can be installed on Linux and then used to compile a windows pgm.
Maybe someone familiar with Wine or some such can help.

I don't think Wine should be necessary. Of course, for testing and debugging it may be used, but for cross-compiling, one shouldn't need Wine.

I found a page on cross-compiling wxWidgets under Linux (http://www.wxwidgets.org/wiki/index.php/Cross-Compiling_Under_Linux), which is supposed to result in a set of wxMSW header/object files. I ran configure, make and make install, and that seems to have worked out all OK. I'll check whether it has produced something useful later.

FreeSouth


Morphius Faydal

Now if only the Gentoo ebuilds of MinGW weren't broken...

Also; on a stylistic note; MingW32 isn't the proper name for the cross compiler.. MinGW is the "official" naming, standing for "Minimal GNU for Windows".. Min.. G.. W. :)

alchemist

Quote from: Morphius Faydal on October 19, 2007, 06:25:16 PM
Now if only the Gentoo ebuilds of MinGW weren't broken...

Also; on a stylistic note; MingW32 isn't the proper name for the cross compiler.. MinGW is the "official" naming, standing for "Minimal GNU for Windows".. Min.. G.. W. :)

Hello, what did you tried ? crossdev ?
Kind Regards,
Xavier Miller.
[url="http://xaviermiller.be"]http://xaviermiller.be[/url]

Morphius Faydal

Quote from: alchemist on October 20, 2007, 10:41:10 AM
Quote from: Morphius Faydal on October 19, 2007, 06:25:16 PM
Now if only the Gentoo ebuilds of MinGW weren't broken...

Also; on a stylistic note; MingW32 isn't the proper name for the cross compiler.. MinGW is the "official" naming, standing for "Minimal GNU for Windows".. Min.. G.. W. :)

Hello, what did you tried ? crossdev ?

The two actual ebuilds for MinGW in Portage both have notes in them stating that they're broken.

alchemist

Last year I tried crossdev with no success. I am emerging it now and testing it.

I think we could only use the non-ebuild cross-building scripts ;)
Kind Regards,
Xavier Miller.
[url="http://xaviermiller.be"]http://xaviermiller.be[/url]

alchemist

#23
OK, after running crossdev --target mingw32I got#mingw32-g++ --version
mingw32-g++ (GCC) 4.2.2 (Gentoo 4.2.2 p1.0)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Next step : cross-build binutils, gcc, w32api et wxMSW ;)

EDIT: done (i'm in 64 bits) USE="-* contrib unicode xrc" ROOT=/data/mingw32-build/ CHOST=mingw32 CBUILD="x86_64-pc-linux-gnu" emerge -1av --nodeps sys-devel/binutils sys-devel/gcc w32api make wxGTK

but cross-compilation of code::blocks through emereg didn't worked:checking for wx-config... /usr/lib64/wx/config/gtk2-unicode-release-2.8
checking for wxWidgets version >= 2.6.0... no


I will take a look later.

Moreover, emerge installed binutils and gcc with too many symlinks I'll have to manually adjust.

Maybe I'll use the standard "./configure && make && make install" procedures.
Kind Regards,
Xavier Miller.
[url="http://xaviermiller.be"]http://xaviermiller.be[/url]

wvdakker

I have installed CodeBlocks, Mingw and wxWidgets in Linux.
Transfered a project created in Windows to the Linux env.
The DLL-files are build ok but there are no library files (.a) created.
The option 'Create import library' is enabled, but nothing there.

Any clue??

gr,
Willem

mandrav

Quote from: wvdakker on November 19, 2007, 01:50:42 PM
I have installed CodeBlocks, Mingw and wxWidgets in Linux.
Transfered a project created in Windows to the Linux env.
The DLL-files are build ok but there are no library files (.a) created.
The option 'Create import library' is enabled, but nothing there.

Any clue??

gr,
Willem

There are no "import libraries" in linux. You create shared objects (.so, equivalent to .dll) or static libraries (.a).
Be patient!
This bug will be fixed soon...

wvdakker

Quote from: mandrav on November 19, 2007, 01:59:43 PM

There are no "import libraries" in linux. You create shared objects (.so, equivalent to .dll) or static libraries (.a).

If I am crosscompiling for windows then libs must be available... or ....??
Otherwise how do I link dll's to other dll's or exe files.


wvdakker

Found the problem :)

These options where missing in the MingW32 Cross Compiler settings.
-Wl,--output-def=$def_output -Wl,--out-implib=$static_output -Wl,--dll

Adding them solved the problem.

szurilo

Hi!
I installed mingw32 and set up the parameters of the GNU GCC compiler.
I realized the i586-mingw32msvc-gcc g++ etc. files are not in the /usr directory but the /usr/bin.
So i set the correct paths and files and set this copy of the compiler as default as this thread write them.
After this, I created a new empty console application project and a new build target.
I don't know whether is a must or not to set the platform to 'Windows' or i can leave it to 'All'.
Anyway i tried both. Actually i am really confused about the Project Settings tab, because its also consists a Platform option. :shock:
So i checked my Build target Files and click OK.
I selected my build target in the Build menu and push the magic Build button.
The output can be different according to i set the platforms type in the Project/Properties menu.
If i set it 'Windows', i got this message and no output created:
"proba" does not support the current platform. Skipping...
Nothing to be done.
If i leave the platform type on 'All' my project is builded and i got one output file without 'exe' extension and i cant run it with wine bec. its a Linux file, i guess.
So what is the problem?
CB 4893 nightly; wxWidgets 2.8.7; distro: Debian;

Szurilo

HalfNote5

Thanks!

I'm an old C++ programmer, but new to Code::Blocks.  It's great to be able to write a C++ program, and without moving it back and forth, be able to write it on my linux lappy, and compile it for all with Win32 machines of the clients that are buying it.  ; )


Many thanks!
You're  a kind person to detail the steps for the rest of us.