Issue with SDL on Ubuntu using Sun Studio 12

Hi,

I’ve been trying out the Sun Studio 12 IDE and the sun suite of compiler
that ships with it. I’m using Ubuntu and when I compile a file with the
SDL includes:

#include “SDL/SDL.h”
#include “SDL/SDL_thread.h”
#include “SDL/SDL_opengl.h”

I get an error:

“/usr/include/SDL/begin_code.h”, line 126: Error: #define and #undef are
not legal for predefined macros.

which is this line:

#define inline inline

I’m not sure what it means. Does anyone have any hints to make things
build? Do I have to build SDL using the sun compilers and link and
include from that install?

Thanks in advance,
Eugene

Eugene Marcotte <emarcotte gmail.com> writes:

I get an error:

“/usr/include/SDL/begin_code.h”, line 126: Error: #define and #undef are
not legal for predefined macros.

which is this line:

#define inline inline

Try replacing that with the following:
#ifndef inline
#define inline inline
#endif

“/usr/include/SDL/begin_code.h”, line 126: Error: #define and #undef are
not legal for predefined macros.

This is in the bugtracker, btw:

http://bugzilla.libsdl.org/show_bug.cgi?id=434

–ryan.

Oh wow. I didn’t even realize there was a bug tracker :slight_smile:

I will try the workaround Sam Crow mentioned for the time being.

Thanks everyone,
EugeneOn Thu, 2007-06-14 at 01:56 -0400, Ryan C. Gordon wrote:

“/usr/include/SDL/begin_code.h”, line 126: Error: #define and #undef are
not legal for predefined macros.

This is in the bugtracker, btw:

http://bugzilla.libsdl.org/show_bug.cgi?id=434

–ryan.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org