Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: sasq on May 02, 2006, 11:30:01 pm

Title: Compiling Win32 apps in C:B + GCC under Linux
Post by: sasq on May 02, 2006, 11:30:01 pm
Hello.

Is it possible to compile Win32 GUI apps [using Win32 API] with GCC under Linux?
If yes, how to do it?
I mean, how to install Win32 SDK headers/libs and where to make it possible for GCC to use it with C::B?
Can I use that Win32SDK package for MinGW ? Or maybe there is a special package for GCC/Linux?

I've tried to add paths to my MinGW include dir on Windows partition under C::B compiler options, but I've got some strange errors [maaany of them! :/ ].
Title: Re: Compiling Win32 apps in C:B + GCC under Linux
Post by: TDragon on May 02, 2006, 11:38:04 pm
The MinGW website would be the obvious place to look. I found this (http://www.mingw.org/mingwfaq.shtml#faq-cross) without even hitting Google...
Title: Re: Compiling Win32 apps in C:B + GCC under Linux
Post by: thomas on May 02, 2006, 11:56:53 pm
This is not easy, but it is possible using at least two different approaches.

First, gcc can be configured as a cross-compiler and as such, it can generate Windows applications from Linux. Don't ask me how to set up cross-compiling though, I wish I knew (I'd use it the other way around if I did).

Second, there is a gcc drop-in replacement which runs the compiler on a different machine via ssh. I forgot its name, but it is hosted on Sourceforge, should be easy enough to find under "compilers".
That way, you need another PC (or a virtual machine running on the same PC) with Windows installed, and you can compile Windows applications natively, doing the actual work from Linux, though. It is a bit less elegant than cross-compiling, but it surely needs less setup.
Title: Re: Compiling Win32 apps in C:B + GCC under Linux
Post by: bluekid on May 03, 2006, 07:34:38 am
look winelib (http://www.winehq.org/site/docs/winelib-guide/winelib-introduction#WINELIB-WHATIS)
Title: Re: Compiling Win32 apps in C:B + GCC under Linux
Post by: Michael on May 03, 2006, 07:53:37 am
Hello,

Look at here:

http://forums.codeblocks.org/index.php?topic=2688.0

Best wishes,
Michael
Title: Re: Compiling Win32 apps in C:B + GCC under Linux
Post by: thomas on May 03, 2006, 09:13:26 am
look winelib (http://www.winehq.org/site/docs/winelib-guide/winelib-introduction#WINELIB-WHATIS)
Right, Wine is a third solution, and probably the best of all.

That way, you can just run MinGW under Linux and don't need to worry about anything. :)
Title: Re: Compiling Win32 apps in C:B + GCC under Linux
Post by: David Perfors on May 03, 2006, 09:31:21 am
From the website of MinGW: http://mingw.org/MinGWiki/index.php/build%20a%20Win32%20x-compiler%20for%20Linux (http://mingw.org/MinGWiki/index.php/build%20a%20Win32%20x-compiler%20for%20Linux)