views:

58

answers:

3

I am using gcc/g++ to compile c/c++ applications - living on OpenSuSe btw.

Is there any way (some option i guess) so that g++ will produce an executable suitable for windows ?

A: 

You'll have to be running g++ on Windows to get a Windows executable out of the other end.
Check out mingw or cygwin.

applechewer
Actually, that's not quite true: cross compilation is possible with GCC.
Robert P
@Robert P: If it's possible, can you tell me how ?
VaioIsBorn
Take a look at AndiDog's answer; my comment was more regarding applechewer's remark that you *have* to be running on Windows. (FYI, mingw is a particular build of gcc that makes Windows executables.)
Robert P
Thanks Robert, that's good to know.
applechewer
+3  A: 

You can search for a mingw32 package in OpenSuSE (I know there is one for Debian) or install it manually. Then if you have a configure script the command line would be something like this in order to have make use the MinGW cross-compilation toolchain:

./configure --prefix=/usr/local --target=i386-mingw32

mingw.org also has a tutorial on building a cross compiler, don't know if that works.

(As an aside: Some websites point to mirzam.it.vu.nl/mingw containing MinGW RPM packages but it seems like that site is down.)

AndiDog
A: 

Check out MinGW Cross and related links:

http://www.nongnu.org/mingw-cross-env/#see-also

Johann Philipp Strathausen