Jump to content
• Advertisement

# cross compilation woes..

This topic is 4843 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

## Recommended Posts

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.

#### Share this post

##### Share on other sites
Advertisement
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

#### Share this post

##### Share on other sites
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.

#### Share this post

##### Share on other sites
Quote:
 Original post by markrSave 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.

#### Share this post

##### Share on other sites
Not to bring up a dead thread, but did you ever get it working?

#### Share this post

##### Share on other sites
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.

#### Share this post

##### Share on other sites
Well, good luck. I'm interested in cross-compiling, and it seems that there isn't a very clear tutorial on the topic available.

#### Share this post

##### Share on other sites
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.

#### Share this post

##### Share on other sites

• Advertisement
• Advertisement
• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

(You must login to your GameDev.net account.)

• ### Popular Now

• 16
• 15
• 28
• 12
• 14
• Advertisement
• ### Forum Statistics

• Total Topics
634805
• Total Posts
3019365
×

## Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!