I make this program in C++ using Code::Blocks on Ubuntu. I need to turn it into a Windows executable binary (.exe file), but I don't know how to do this. Is it possible?
-
possible dupe? http://stackoverflow.com/questions/1702945/compiling-windows-binaries-from-ubuntu – KillianDS May 06 '10 at 15:17
-
1Why would you want a .exe file on Ubuntu? Do you want to cross-compile for Windows? – Fred Larson May 06 '10 at 15:18
-
I want to create a .exe file because the program will be tested on Windows. I just hate Windows so I don't use it. – user69514 May 06 '10 at 15:21
-
1@user69514: Now that's a very different question from what I thought you asked... I've slightly changed the question to reflect this. – sbi May 06 '10 at 15:23
-
Why don't you install Code::Blocks on Windows and compile it there? It's supposed to be a cross-platform IDE, after all. – sbi May 06 '10 at 15:26
-
When I compress a file in Unbutun it gives me an option for .exe as file extension. I'm wondering if this would be a valid conversion – user69514 May 06 '10 at 15:29
-
Actually I just remember I have XP installed in Sun's Virtual Box. Let me try doing there – user69514 May 06 '10 at 15:31
-
2I suspect that'd create a self-extracting zip file, not convert your executable for Windows. – Fred Larson May 06 '10 at 15:31
-
Yeah I installed bloodshed on the virtual machine xp. it worked fine. thanks all – user69514 May 06 '10 at 16:01
4 Answers
If you meant, compiling an executable for Windows on Linux you might find some pointers on how to do that here.

- 56
- 9

- 142
- 4
Both the MinGW32 distribution of GCC and Wine should be available for your distribution.
MinGW has instructions and winegcc wraps a similar compiler that comes with the Wine distribution.
I've used both to compile both applications and libraries for Windows.

- 24,948
- 7
- 64
- 80
You could read here on how to compile wxWidget applications on Linux for Windows using Code::Blocks.

- 97,037
- 24
- 136
- 212
This is a fairly unusual question. What you're asking is that you want to develop on Ubuntu, but the target platform is Windows?
My guess is that you have an assignment to turn in. My belief is that you should go to a lab and compile it and make sure it's working.
However, doing some research, you should try mingw at http://www.mingw.org/

- 878
- 6
- 5