Advertisement

cross compilation woes..

Started by November 23, 2005 09:19 AM
6 comments, last by hplus0603 18 years, 9 months ago
I'm trying to compile a windows version of my game to distribute to the heathens and I don't have access to a windows box so I thought I would give cross-compilation a go. I'm using ubuntu atm so apt-getted the mingw32 package. This gives me a version of gcc et al with the suffix i586-mingw32msvc. I'm using autotools so ran ./configure --host=i586-mingw32msvc. Everything seems good until it gets to:
checking for GNU libc compatible realloc... no
Well, I thought i might be able to get away with it seems as i'm not using realloc etc so run make anyway.. but it turns out realloc is used by the stl so compiling fails. cstdlib is included by some stl headers which I include so I get the error:
/usr/lib/gcc/i586-mingw32msvc/3.4.2/include/c++/cstdlib:111: error: `::realloc' has not been declared
After googling for a while it turns out that other people have had similar problems but noone says how to fix it. I'm thinking there's either something wrong with the options I pass to configure (which i've tried various different combinitions for) or with the build environment itself.. So i was just wondering if anyone had any similar problem and managed to fix it or had any successes with cross-compiling from ubuntu/any other linux and has any suggestions of what to do.
Save your effort.

Even if you manage to build a win32 version of your game under Linux, do you really expect it to work with no testing whatsoever?

You'll need a Windows box to test the program anyway, so there's no point in cross-compiling. Really.

If you plan to release binaries, you'll probably need several different versions of Windows with different hardware etc, to test it thoroughly.

Mark
Advertisement
Yes, I realise that a significant amount of testing on various machines would be required before fully realising a product into the wild however at the moment I just want to quickly compile a windows version to give to a few friends. I'd briefly test in wine/cedega/whatever and then send it on its way.

Anyways, for now i got around the problem by installing windows xp in vmware and using devcpp. It's a temporary solution until I can trick this cross compiling into working or my 30 day vmware trial runs out and I'm stuck with the same problem again.
Quote: Original post by markr
Save your effort.

Even if you manage to build a win32 version of your game under Linux, do you really expect it to work with no testing whatsoever?

You'll need a Windows box to test the program anyway, so there's no point in cross-compiling. Really.

If you plan to release binaries, you'll probably need several different versions of Windows with different hardware etc, to test it thoroughly.

Mark



Even so, I think it would be useful to be able to run make from one place and create builds for all of your targets. You can always scp or ftp the build to a Windows box and have a script automate some tests to verify that the program installs or otherwise works. You can test it in Wine. You could build something quickly for a friend without having to reboot your machine. There are quite a few good reasons for having the ability to use a cross-compiler.

I am actually looking into using mingw myself.
-------------------------GBGames' Blog: An Indie Game Developer's Somewhat Interesting ThoughtsStaff Reviewer for Game Tunnel
Not to bring up a dead thread, but did you ever get it working?
-------------------------GBGames' Blog: An Indie Game Developer's Somewhat Interesting ThoughtsStaff Reviewer for Game Tunnel
Nope, not yet. Haven't really looked into it much more, just been using windows + devcpp under vmware to compile at the moment. I'll have another go at making it work when I get the chance, probably after christmas though. I expect it's something to do with the package I used to install the crosscompiling tools so maybe if I install it all manually i'll have more luck.. dunno.
Advertisement
Well, good luck. I'm interested in cross-compiling, and it seems that there isn't a very clear tutorial on the topic available.
-------------------------GBGames' Blog: An Indie Game Developer's Somewhat Interesting ThoughtsStaff Reviewer for Game Tunnel
Be sure to use the windows-specific headers, rather than the local UNIX headers. I don't know how MinGW distributes these -- it may be that you need to download and install the Platform SDK to have the right headers and libraries.
enum Bool { True, False, FileNotFound };

This topic is closed to new replies.

Advertisement