Cross-compiling other SDL-using programs

Hi,

I read through the mailing list archive and found the info on cross
compiling from linux to win32. I installed the cross compiler as
directed, and cross compiled SDL and SDL_image just fine. Now I want to
cross compile another SDL using application, but when I do a
cross-configure, it tells me it can’t find SDL_image.h. What extra
things need to be put in the configure.in? I’m not terribly experienced
with using autoconf, so maybe I’m missing something easy, but I’d
appreciate any info.

I think by now there should probably be a HOWTO or at least a FAQ on
cross compiling :slight_smile:

Thanks,
-Ted

I put together a little page that might help to get you started:

http://david.acz.org/sdl.html

There’s a skeleton project there that you can modify to suit your needs. I
basically took existing setups from projects and the SDL tests and hacked
them down to what I needed. The automake/autoconf manuals do a decent job
of explaining what everything does, but things still act strange sometimes
and it takes some messing around to get it to work.> I read through the mailing list archive and found the info on cross

compiling from linux to win32. I installed the cross compiler as
directed, and cross compiled SDL and SDL_image just fine. Now I want to
cross compile another SDL using application, but when I do a
cross-configure, it tells me it can’t find SDL_image.h. What extra
things need to be put in the configure.in? I’m not terribly experienced
with using autoconf, so maybe I’m missing something easy, but I’d
appreciate any info.

Nice page and example, but it doesn’t work for cross compiling for me
:slight_smile: Works fine compiling normally, but when I do a cross-configure, i get:

checking whether the C++ compiler (c++ ) works… no
configure: error: installation or configuration problem: C++ compiler
cannot create executables.

I’ve successfully cross-compiled SDL, so I’m pretty sure everything
works, but this might be just a C++ problem. Any ideas?

-Ted

David Phillips wrote:> I put together a little page that might help to get you started:

http://david.acz.org/sdl.html

There’s a skeleton project there that you can modify to suit your needs. I
basically took existing setups from projects and the SDL tests and hacked
them down to what I needed. The automake/autoconf manuals do a decent job
of explaining what everything does, but things still act strange sometimes
and it takes some messing around to get it to work.

Ted Mielczarek writes:

Nice page and example, but it doesn’t work for cross compiling for me
:slight_smile: Works fine compiling normally, but when I do a cross-configure, i
get:

checking whether the C++ compiler (c++ ) works… no
configure: error: installation or configuration problem: C++ compiler
cannot create executables.

I’ve successfully cross-compiled SDL, so I’m pretty sure everything
works, but this might be just a C++ problem. Any ideas?
Read config.log, and post further information.–
Best Regards / Venlig Hilsen
Rasmus Toftdahl Olesen
halfdan at halfdan.dyndns.org
http://halfdan.dyndns.org

Ted Mielczarek writes:

:checking whether the C++ compiler (c++ ) works… no
:configure: error: installation or configuration problem: C++ compiler
:cannot create executables.
:
:I’ve successfully cross-compiled SDL, so I’m pretty sure everything
:works, but this might be just a C++ problem. Any ideas?

I don’t know anything about cross-compiling, but that error for me (in
using the native compiler) has always meant that the preprocessor
can’t find the library it needs.–
Tony Reed
<@Tony_Reed>

Nice page and example, but it doesn’t work for cross compiling for me
:slight_smile: Works fine compiling normally, but when I do a cross-configure, i get:

checking whether the C++ compiler (c++ ) works… no
configure: error: installation or configuration problem: C++ compiler
cannot create executables.

I’ve successfully cross-compiled SDL, so I’m pretty sure everything
works, but this might be just a C++ problem. Any ideas?

You don’t need C++ if you are just doing C. In that case, you can just
remove the check for the C++ compiler and standard C++ library from the
configure.in file. However, if you built the Xmingw compiler using the
script on the SDL page, then it should have built the full set of tools,
including the C++ compiler. It did for me, at least.

Rasmus Toftdahl Olesen wrote:

Ted Mielczarek <@Ted_Mielczarek> writes:

Nice page and example, but it doesn’t work for cross compiling for me
:slight_smile: Works fine compiling normally, but when I do a cross-configure, i
get:

checking whether the C++ compiler (c++ ) works… no
configure: error: installation or configuration problem: C++ compiler
cannot create executables.

I’ve successfully cross-compiled SDL, so I’m pretty sure everything
works, but this might be just a C++ problem. Any ideas?

Read config.log, and post further information.

from config.log:

configure:1097: checking whether the C++ compiler (c++ ) works
configure:1113: c++ -o conftest conftest.C 1>&5
as: unrecognized option `-Qy’
configure: failed program was:

#line 1108 “configure”
#include “confdefs.h”

int main(){return(0);}

Looks like it’s either not finding the right as, or that as is broken.
Still not sure what’s wrong.

-Ted

Ted Mielczarek wrote:

Nice page and example, but it doesn’t work for cross compiling for me
:slight_smile: Works fine compiling normally, but when I do a cross-configure, i get:

checking whether the C++ compiler (c++ ) works… no
configure: error: installation or configuration problem: C++ compiler
cannot create executables.

I’ve successfully cross-compiled SDL, so I’m pretty sure everything
works, but this might be just a C++ problem. Any ideas?

-Ted

By default, the cross compiler build script does not make links for the
C++ front end.

ln /usr/local/cross-tools/i386-mingw32msvc/bin/g++
/usr/local/cross-tools/bin/i386-mingw32msvc-g++

and so on for a few others (c++ and dllwrap come to mind)

-Ray