SDL compile error

Hi list,

I’m new to SDL, trying to compile a simple program using SDL, SDL_ttf and
SDLGUI library.
I’m reveiving a strange error about “string.h”.

[root at Purgatory arrayrev]# g++ -o main main.cpp sdl-config --cflags --libs -I/usr/include/SDL/SDLGUI
In file included from /usr/include/memory.h:30,
from /usr/include/SDL/SDLGUI/SDLHelpers.h:13,
from /usr/include/SDL/SDLGUI/SDLGUIItem.h:10,
from /usr/include/SDL/SDLGUI/SDLGUI.h:14,
from main.cpp:3:
/usr/include/string.h:28: error: syntax error before string constant
In file included from /usr/include/memory.h:30,
from /usr/include/SDL/SDLGUI/SDLHelpers.h:13,
from /usr/include/SDL/SDLGUI/SDLGUIItem.h:10,
from /usr/include/SDL/SDLGUI/SDLGUI.h:14,
from main.cpp:3:
/usr/include/string.h:400: error: syntax error before `}’ token
[root at Purgatory arrayrev]# rpm -q SDL SDL-devel
SDL-1.2.7-3
SDL-devel-1.2.7-3

Any ideas what might be causing this ?

Thanx in advance

Efthym

Efthym wrote:

Hi list,

I’m new to SDL, trying to compile a simple program using SDL, SDL_ttf
and SDLGUI library.
I’m reveiving a strange error about “string.h”.

[root at Purgatory arrayrev]# g++ -o main main.cpp sdl-config --cflags --libs -I/usr/include/SDL/SDLGUI
In file included from /usr/include/memory.h:30,
from /usr/include/SDL/SDLGUI/SDLHelpers.h:13,
from /usr/include/SDL/SDLGUI/SDLGUIItem.h:10,
from /usr/include/SDL/SDLGUI/SDLGUI.h:14,
from main.cpp:3:
/usr/include/string.h:28: error: syntax error before string constant
In file included from /usr/include/memory.h:30,
from /usr/include/SDL/SDLGUI/SDLHelpers.h:13,
from /usr/include/SDL/SDLGUI/SDLGUIItem.h:10,
from /usr/include/SDL/SDLGUI/SDLGUI.h:14,
from main.cpp:3:
/usr/include/string.h:400: error: syntax error before `}’ token
[root at Purgatory arrayrev]# rpm -q SDL SDL-devel
SDL-1.2.7-3
SDL-devel-1.2.7-3

Interesting indeed ^^

The first thing I’d do is write a simple test program that uses string.h
(that’s the C version, included with from C++, not the C++
header which contains the string class) and see if it compiles.

The other possibility I see is that SDLGUI is somehow incompatible with
your compiler version and introduces an error before string.h is included.

By the way, I did not find any library called SDLGUI during a quick
google. Do you mean SDL_gui, or am I just unable to find the library you
mean? Could you provide a link? ^^

Efthym

Sebastian

I have used string.h before without any problems. I also tried one of the
SDL demos (only a blank window) and that worked as well.
SDLGUI was provided on the book I have “Data structures for game
programming” by Ron Penton. I checked out the SDL_gui but they dont seem
to be same.
Maybe you’re right, there’s some incompatibility between the SDLGUI and my
compiler. I had some other problems with it before, but managed to solve
them.
Guess the only thing left is go through the SDLGUI source code and
hopefully find something.

By the way i’m using Fedora Core 2,
[root at Purgatory SDL]# g++ --version
g++ (GCC) 3.3.3 20040412 (Red Hat Linux 3.3.3-7)
Copyright © 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Thanx for your help

EfthymOn Tue, 30 Nov 2004 20:43:34 +0100, Sebastian Beschke <s.beschke at gmx.de> wrote:

Efthym wrote:

Hi list,
I’m new to SDL, trying to compile a simple program using SDL, SDL_ttf
and SDLGUI library.
I’m reveiving a strange error about “string.h”.
[root at Purgatory arrayrev]# g++ -o main main.cpp sdl-config --cflags --libs -I/usr/include/SDL/SDLGUI
In file included from /usr/include/memory.h:30,
from /usr/include/SDL/SDLGUI/SDLHelpers.h:13,
from /usr/include/SDL/SDLGUI/SDLGUIItem.h:10,
from /usr/include/SDL/SDLGUI/SDLGUI.h:14,
from main.cpp:3:
/usr/include/string.h:28: error: syntax error before string constant
In file included from /usr/include/memory.h:30,
from /usr/include/SDL/SDLGUI/SDLHelpers.h:13,
from /usr/include/SDL/SDLGUI/SDLGUIItem.h:10,
from /usr/include/SDL/SDLGUI/SDLGUI.h:14,
from main.cpp:3:
/usr/include/string.h:400: error: syntax error before `}’ token
[root at Purgatory arrayrev]# rpm -q SDL SDL-devel
SDL-1.2.7-3
SDL-devel-1.2.7-3

Interesting indeed ^^

The first thing I’d do is write a simple test program that uses string.h
(that’s the C version, included with from C++, not the C++
header which contains the string class) and see if it compiles.

The other possibility I see is that SDLGUI is somehow incompatible with
your compiler version and introduces an error before string.h is
included.

By the way, I did not find any library called SDLGUI during a quick
google. Do you mean SDL_gui, or am I just unable to find the library you
mean? Could you provide a link? ^^

Efthym

Sebastian


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Opera M2 on Fedora Core 2