PDA

View Full Version : Compile a window .exe from a cross-platform program, on Linux?



crazyfuturamanoob
March 4th, 2009, 05:22 PM
I know this is possible and it's been done before. But I just can't find anything with forum search.

So how can I compile an application for windows, on my Ubuntu? And the program needs SDL, SDL_image, SDL_mixer, and SDL_ttf.

Thanks.

agim
March 4th, 2009, 05:49 PM
try wine
http://www.winehq.org/

simeon87
March 4th, 2009, 06:06 PM
try wine
http://www.winehq.org/

Wine is for running, not for compiling...

Simian Man
March 4th, 2009, 06:07 PM
You likely won't find a satisfactory way to do this. Especially using libraries. Just find a Windows machine with a compiler.

Tibuda
March 4th, 2009, 06:26 PM
You can install MingW32 compilers from the repositories.

crazyfuturamanoob
March 4th, 2009, 07:32 PM
How can I use mingw?

I don't have a windows, and I don't know anything about compiling stuff on windows. (like linking sdl)

cmat
March 4th, 2009, 07:45 PM
Either get a program like Dev-C++ (comes with a Borland compiler I think) and run it under Windows. I think you can cross compile with Mingw but I never used it.

Tibuda
March 4th, 2009, 07:45 PM
How can I use mingw?
I don't have a windows, and I don't know anything about compiling stuff on windows. (like linking sdl)
It's the same as gcc.

You won't be able to link your native Linux SDL. You need to download the windows SDL source code and compile the library using MingW32. I can't help very much, but this tutorial (http://wiki.wxwidgets.org/Cross-Compiling_Under_Linux) teachs how to do it with wxWidgets. Once you have your compiled windows library, you can link your program using mingw compiler, as you would do with gcc.

EDIT: I believe this link is what you are looking for: http://www.libsdl.org/extras/win32/cross/README.txt

crazyfuturamanoob
March 4th, 2009, 08:17 PM
Either get a program like Dev-C++ (comes with a Borland compiler I think) and run it under Windows. I think you can cross compile with Mingw but I never used it.

I said I don't have a windows! I hate windows, I don't play much commercial games, I don't need windows. But otherwise I'd compile under windows. (if I had one)


It's the same as gcc.

You won't be able to link your native Linux SDL. You need to download the windows SDL source code and compile the library using MingW32. I can't help very much, but this tutorial (http://wiki.wxwidgets.org/Cross-Compiling_Under_Linux) teachs how to do it with wxWidgets. Once you have your compiled windows library, you can link your program using mingw compiler, as you would do with gcc.

EDIT: I believe this link is what you are looking for: http://www.libsdl.org/extras/win32/cross/README.txt

Thanks. That's what I was looking for. But I want to include SDL as static, how to do that then? (even with gcc for Linux)