Compiling programs for Windows on Linux
I have a Mac and a Linux PC, and I want to compile a game I made in C++ so it will work on Windows. I tried running MinGW with WINE, but got a lot of strange errors when compiling my program. With some Google searching, I found some info on cross compiling with GCC, but it sounded extremely complicated. What is the easiest way to do this? I have only been using Linux (Ubuntu) since December, so I still don't know a whole lot about it.
Thanks. |
Sounds like you need the Mono Project: http://www.mono-project.com/Main_Page.
|
Your big problem is that the app will need to make major use of windows gui dll's that you don't have on the other OS's. The API for those is proprietary (recently opened, but not available yet?).
Your best bet for long-term cross platform gui development is to use a cross-platform gui framework. I think Gtk is working on this for windows. There is a commercial one called XVT. You might have major issues if your game uses sound and complex video like 3d acceleration, since these require OS-specific drivers. |
JWPurple's idea of using Gtk+ on Windows is a good way to port your game to Windows. Another way to do the same thing is to use Qt.
http://freshmeat.net/projects/qt/ ---------------------- Steve Stites |
Thanks for the replies. I am actually using the Allegro library. Would I still have to use windows GUI? On the Mac I didn't need to use any OS specific libraries.
|
Quote:
|
COMPILING THE mingw32 CROSS COMPILERS.
This is only a guide. It is real rough. You may need to fill in some of the potholes that are deliberately dug in your path by "Linux people." However, it should point you in the right direction. This, plus some fancy footwork, worked for gcc-4.1.1 Download: ftp://gcc.gnu.org/pub/binutils/relea...s-2.18.tar.bz2 ftp://gcc.gnu.org/pub/binutils/releases/md5.sum ftp://gcc.gnu.org/pub/gcc/releases/g...-4.2.3.tar.bz2 ftp://gcc.gnu.org/pub/gcc/releases/g...-4.2.3.tar.bz2 ftp://gcc.gnu.org/pub/gcc/releases/g...-4.2.3.tar.bz2 ftp://gcc.gnu.org/pub/gcc/releases/g...-4.2.3.tar.bz2 ftp://gcc.gnu.org/pub/gcc/releases/g...-4.2.3.tar.bz2 ftp://gcc.gnu.org/pub/gcc/releases/g...-4.2.3.tar.bz2 ftp://gcc.gnu.org/pub/gcc/releases/g...-4.2.3.tar.bz2 ftp://gcc.gnu.org/pub/gcc/releases/g...-4.2.3.tar.bz2 ftp://gcc.gnu.org/pub/gcc/releases/gcc-4.2.3/md5.sum http://downloads.sourceforge.net/min....11-src.tar.gz http://downloads.sourceforge.net/min....14-src.tar.gz Get the include files to the right place: tar zxf w32api-3.11.tar.gz tar zxf mingw-runtime-3.14.tar.gz cp -r mingw-runtime-3.14/include/* /usr/local/mingw32/include cp -r w32api-3.11/include/* /usr/local/mingw32/include Build binutils-2.18 with: ./configure --target=mingw32 --program-prefix=mingw32 make make install Now build gcc: for a in *4.2.3*.tar.bz2; do tar xf $a; done They all open into the directory gcc-4.2.3 Create the compiler to build the libraries ./configure --target=mingw32 --with-headers=/usr/local/mingw32/include --enable-languages=c make make install cd w32api-3.11 ./configure --target=mingw32 --host=mingw32 --build=i686-pc-linux-gnu ln -s w32api-3.11 w32api cd mingw-runtime-3.14 ./configure --target=mingw32 --host=mingw32 --build=i686-pc-linux-gnu Create the mingw32 C & C++ COMPILERS ./configure --target=mingw32 --with-headers=/usr/local/mingw32/include --enable-languages=c,c++ --disable-libssp --enable-sjlj-exceptions make make install |
I will go through the compilation when I get time and check the commands.
|
Note that i missed the line:
ln -s w32api-3.11 w32api I just added it. |
Deleted a little misleading info.
|
Don't forget to change --build=i686-pc-linux-gnu to whatever type your machine is.
|
Anyone tried the compilation?
|
BTW you have to clean up between the builds.
|
Tried it. It works.
|
Quote:
|
All times are GMT -5. The time now is 09:35 AM. |