Author Topic: Compiling Win32 apps in C:B + GCC under Linux  (Read 5056 times)

Offline sasq

  • Multiple posting newcomer
  • *
  • Posts: 13
Compiling Win32 apps in C:B + GCC under Linux
« 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! :/ ].

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: Compiling Win32 apps in C:B + GCC under Linux
« Reply #1 on: May 02, 2006, 11:38:04 pm »
The MinGW website would be the obvious place to look. I found this without even hitting Google...
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Compiling Win32 apps in C:B + GCC under Linux
« Reply #2 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.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline bluekid

  • Multiple posting newcomer
  • *
  • Posts: 57
  • What is blue ? Blue is the invisible becoming visi
Re: Compiling Win32 apps in C:B + GCC under Linux
« Reply #3 on: May 03, 2006, 07:34:38 am »
look winelib
What is blue ? Blue is the invisible becoming visible.

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Compiling Win32 apps in C:B + GCC under Linux
« Reply #4 on: May 03, 2006, 07:53:37 am »
Hello,

Look at here:

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

Best wishes,
Michael

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Compiling Win32 apps in C:B + GCC under Linux
« Reply #5 on: May 03, 2006, 09:13:26 am »
look winelib
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. :)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring