Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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.
From the Allegro introduction, what you need for windows compiling is on of these: Windows (MSVC, MinGW, Cygwin, Borland). I would interpret that to mean you need to use one of these development environments on a windows machine, using the Allegro libraries. I don't think Allegro is a cross-compiler from linux->windows. It probably worked on the Mac because of the OS X platform that provides linux-compatible libraries already. Windows is not likely to do that for the forseeable future.
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
./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
Last edited by ComputerGreek; 02-27-2008 at 06:47 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.