Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » cross compile HOWTO

This thread is locked; no one can reply to it. rss feed Print
cross compile HOWTO
kazzmir
Member #1,786
December 2001
avatar

I would like to compile win32 code from linux but dont know where to look or start looking. I searched on the forums and searched www.gnu.org, but havent found much in the way of cross compilation( of course google as well ). So, can anyone point me in the right direction for using gcc to cross compile from linux to win32?

thanks...

CGamesPlay
Member #2,559
July 2002
avatar

mingw32msvc is the package thingie you want. It didn't work for me, btw.

So....
!google mingw32msvc cross compile

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

PyroBoy
Member #725
October 2000
avatar

I belive there is a debian package for the mingw cross compiler. Ive never tryed it though.

Niunio
Member #1,975
March 2002
avatar

Most of my Allegro projects compiles with Linux gcc, MinGW32 and DJGPP, sometimes with minor changes.

My console-'non Allegro' programs also compiles right with the 3 compilers without problems.

Even more, most of cases I can use the same makefile in all enviroments.

Of course, you cannot use specific Win32, Linux or DOS features, as dos.h, io.h, windows.h, X11.h, etc...

ANSI/POSIX covers all my IO needs (stdio.h) and Allegro gives the other.

-----------------
Current projects: Allegro.pas | MinGRo

X-G
Member #856
December 2000
avatar

And even where something requires platform-dependent things, a few #ifdefs usually solve that ...

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Evert
Member #794
November 2000
avatar

I think you need to reconfigure and compile gcc for the specific target (check the output of configure --help, I think the options you're looking for are --host and --target). You may want to check the gcc installation instructions. Anyway, the following section from the gcc manual may be relevant GCC manual->Invoking->Target options.

I also found this, although it refers to setting up a cross-compiler for PlayStation 2, the steps should be similar.

EDIT: a google for gcc, crosscompiler and mingw resolved (among other things) to the Allegro installation manual, mingw32 section to be precise. Not sure how relevant the information there is though.

kazzmir
Member #1,786
December 2001
avatar

nunio: not to be a jerk or anything, but what the heck does that have to do with anything? im glad you are a good coder and all your projects compile with every posix compliant compiler, but thats pretty unrelated to the topic at hand.

anyway, i found some information about it at mingw.org. ill give and update if it worked or not in a bit.

Niunio
Member #1,975
March 2002
avatar

Not be a jerk, don't worry. Some times I talk (write) because I was inspired without think a lot, and some times I do it in the wrong way. That is what we call big-opened-mouth man (bocazas).

Anyway, the idea I had was that you had errors in a cross compile you did, so I wrote that to say 'If you use ANSI/POSIX compliant code then you have less cross compile errors'. If the problem was only that you didn't know what compiler to use, then my comment is out of topic, and I apologize a lot.

-----------------
Current projects: Allegro.pas | MinGRo

Elias
Member #358
May 2000

The cross compiling section in Allegro's mingw32.txt is relevant if you want to cross-compile Allegro itself, using the mingw32 cross-compiler. But it's also possible to use a windows-compiled Allegro library to cross-compile your own Allegro programs, just make the headers and libraries available to mingw.

I really found no difference between using mingw in windows, or using it as a cross-compiler in linux. Only makefiles can't be used directly most of the time, since you still use linux make, so no DOS commands, no DOS pathes, and so on. Cross-compiling things like AllegroGL or DUMB can require some makefile hacking for that reason, the easier solution is to just take the headers and libs from windows-mingw and put in your linux directories.

--
"Either help out or stop whining" - Evert

Go to: