Results 1 to 5 of 5
Hello,
I was wondering if it is at all possible to compile a simple C++ program for 32-bit windows from 64-bit Ubuntu. If it is possible, how would I go ...
- 11-26-2009 #1Just Joined!
- Join Date
- Oct 2007
- Posts
- 47
Compiling C++ for windows in linux.
Hello,
I was wondering if it is at all possible to compile a simple C++ program for 32-bit windows from 64-bit Ubuntu. If it is possible, how would I go around doing it? I am use to compiling C++ and C for my laptop, because I do it all the time for my math assignments, but how would I be able to compile it for windows?
Thank-you
- 11-26-2009 #2
Yes. You need the mingw32 cross compiler. Fedora has several packages with names like mingw32-gcc-c++, and I'm sure Ubuntu's would be similar.
On my Fedora system, the g++ executable is i686-pc-mingw32-g++, which you use just like g++ to compile programs.
Code:i686-pc-mingw32-g++ helloworld.cpp -o helloworld.exe
- 11-30-2009 #3Just Joined!
- Join Date
- Oct 2007
- Posts
- 47
hey KenJackson, it sadly did not work. its not giving me the option of i686-pc-mingw32-g++ at all
- 12-01-2009 #4
Well I just SSH-ed over to my old Ubuntu machine in the corner and ran:
aptitude search mingw32
and it came back with three packages:
mingw32
mingw32-binutils
mingw32-runtime
So tryThen you will have compiler i586-mingw32msvc-g++ and friends.Code:sudo apt-get install mingw32 mingw32-binutils mingw32-runtime
- 12-01-2009 #5Just Joined!
- Join Date
- Oct 2007
- Posts
- 47
thank-you, it seems to be working now. Much appreciated.
Just out of curiousity, i also use QT4. Is it possible to do the same thing with QT?


Reply With Quote
