Stdlib.h:130: syntax error before `int'

I installed gcc as a cross compiler using Ray Kelm’s instructions
(http://www.libsdl.org/Xmingw32/crossgcc/index.html). The installation
was successfull and I’m able to compile simple programs for win32
platform now. Next I tried to compile simple SDL examples like
xflame-1.0 and some others, but kept getting these weird errors. My gcc
prefix is /home/omegas/cross-utils and I use a script "cross-configure"
to invoke the configure scripts. Here’s the script:

PATH=/home/omegas/cross-tools/bin:/home/omegas/cross-tools/i386-mingw32msvc/bin:$PATH

./configure --cache-file=config.cross.cache
–host=i386-mingw32msvc
–target=i386-mingw32msvc
–build=i386-linux
$*

Here’s a try at compiling xflame-1.0:

[omegas at omegas xflame-1.0]$ cross-configure
creating cache config.cross.cache
checking for a BSD compatible install… /usr/bin/install -c
checking whether build environment is sane… yes
checking whether make sets ${MAKE}… yes
checking for working aclocal… found
checking for working autoconf… found
checking for working automake… found
checking for working autoheader… found
checking for working makeinfo… found
checking for gcc… gcc
checking whether the C compiler (gcc ) works… yes
checking whether the C compiler (gcc ) is a cross-compiler… yes
checking whether we are using GNU C… yes
checking whether gcc accepts -g… yes
checking for sdl-config…
/home/omegas/cross-tools/i386-mingw32msvc/bin/sdl-config
checking for SDL - version >= 1.0.1… cross compiling; assumed OK… yes
updating cache config.cross.cache
creating ./config.status
creating Makefile
[omegas at omegas xflame-1.0]$ make
gcc -DPACKAGE=“xflame” -DVERSION=“1.0” -I. -I. -g -O2
-I/home/omegas/cross-tools/i386-mingw32msvc/include
-I/home/omegas/cross-tools/i386-mingw32msvc/include/SDL -Dmain=SDL_main
-c xflame.c
In file included from xflame.c:30:
/home/omegas/cross-tools/i386-mingw32msvc/include/stdlib.h:130: syntax
error before int' In file included from xflame.c:33: /home/omegas/cross-tools/i386-mingw32msvc/include/time.h:206: syntax error beforechar’
make: *** [xflame.o] Error 1

Any ideas of what is causing this? I can compile and link simple
programs using stdlib.h and time.h so they should be functional?
Something wrong with the configure script I’m using?

//Henri Vilminko

Henri Vilminko wrote:

I installed gcc as a cross compiler using Ray Kelm’s instructions
(http://www.libsdl.org/Xmingw32/crossgcc/index.html). The installation
was successfull and I’m able to compile simple programs for win32
platform now. Next I tried to compile simple SDL examples like
xflame-1.0 and some others, but kept getting these weird errors. My gcc
prefix is /home/omegas/cross-utils and I use a script "cross-configure"
to invoke the configure scripts. Here’s the script:

PATH=/home/omegas/cross-tools/bin:/home/omegas/cross-tools/i386-mingw32msvc/bin:$PATH

./configure --cache-file=config.cross.cache
–host=i386-mingw32msvc
–target=i386-mingw32msvc
–build=i386-linux
$*

[cross-configure snipped]

Here’s a try at compiling xflame-1.0:

creating Makefile
[omegas at omegas xflame-1.0]$ make

Maybe you should try ‘cross-make’ instead of make ?

Hope this helps.

            Franck.> gcc -DPACKAGE=\"xflame\" -DVERSION=\"1.0\"  -I. -I.      -g -O2

-I/home/omegas/cross-tools/i386-mingw32msvc/include
-I/home/omegas/cross-tools/i386-mingw32msvc/include/SDL -Dmain=SDL_main
-c xflame.c
In file included from xflame.c:30:
/home/omegas/cross-tools/i386-mingw32msvc/include/stdlib.h:130: syntax
error before int' In file included from xflame.c:33: /home/omegas/cross-tools/i386-mingw32msvc/include/time.h:206: syntax error beforechar’
make: *** [xflame.o] Error 1

Any ideas of what is causing this? I can compile and link simple
programs using stdlib.h and time.h so they should be functional?
Something wrong with the configure script I’m using?

//Henri Vilminko

mailto:fguillaud at ivsweb.com

Franck Guillaud wrote:

Henri Vilminko wrote:

I installed gcc as a cross compiler using Ray Kelm’s instructions
(http://www.libsdl.org/Xmingw32/crossgcc/index.html). The installation
was successfull and I’m able to compile simple programs for win32
platform now. Next I tried to compile simple SDL examples like
xflame-1.0 and some others, but kept getting these weird errors.

creating Makefile
[omegas at omegas xflame-1.0]$ make

Maybe you should try ‘cross-make’ instead of make ?

Hope this helps.

            Franck.

Ehh… It did the job. =) The Makefiles produced by the cross-configure
script all have “CC=gcc” so I’ve been trying to use the wrong compiler
all the time… Thanks a bunch!

//Henri