Compiling SDL in XCode 4.1

Hi,

I tried to build SDL for Mac OS X 10.7.1 using xcode 4.1 and I got these errors:

SDL_opengl.h

5114: error: conflicting types for 'GLintptrARB’
5115: error: conflicting types for ‘GLsizeiptrARB’

What can be done?

I currently have no 10.6 machine to test, but I am almost downgrading this buggy OS =/
I also built the iOS project with no problems.

Regards

Hi Rodrigo,

The latest glext.h is here:
http://www.opengl.org/registry/api/glext.h

it defines GLintptrARB as:

#ifndef GL_ARB_vertex_buffer_object
/* GL types for handling large vertex buffer objects */
typedef ptrdiff_t GLintptrARB;
typedef ptrdiff_t GLsizeiptrARB;
#endif

Looking at SDL_opengl.h it might just work if you do this:

#include <OpenGL/OpenGL.h> // OSX
#include “glext.h” // pull this locally
#include <OpenGL/glext.h> // Or from the framework - probably not the
right include - guessing here…

Also look into NO_SDL_GLEXT macro in SDL_opengl.h - there is a mini or
older version of glext.h there - might give you some more clues
especially if you diff it against latest.

Cheers!On 8/25/2011 7:50 PM, RodrigoCard wrote:

Hi,

I tried to build SDL for Mac OS X 10.7.1 using xcode 4.1 and I got these
errors:

SDL_opengl.h

5114: error: conflicting types for 'GLintptrARB’
5115: error: conflicting types for ‘GLsizeiptrARB’

What can be done?

I currently have no 10.6 machine to test, but I am almost downgrading
this buggy OS =/
I also built the iOS project with no problems.

Regards


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

I tried to build SDL for Mac OS X 10.7.1 using xcode 4.1 and I got these
errors:

Can you try the latest in Mercurial? I just pushed a change that should
fix this.

Thanks,
–ryan.

I’m posting this to the list as I don’t think it merits opening a bug for it.
I’m using the Android port to develop on an Android tablet, and I noticed my
graphics were all pixelated. It turns out, Android by default gives you a
small surface to work with unless you tell it that you support larger screens
in the manifest.
Adding:

to AndroidManifest.xml lets you work at native resolutions.

Gabriel.

Aparently, changing ptrdiff_t to long worked, thanks.

Ryan C. Gordon wrote:>

I tried to build SDL for Mac OS X 10.7.1 using xcode 4.1 and I got these
errors:

Can you try the latest in Mercurial? I just pushed a change that should
fix this.

Thanks,
–ryan.


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

The OS X OpenGL header on Lion defines the GLsizeiptrARB as long if GL_ARB_vertex_buffer_object is not defined, the SDL GL header redefines this as another type. I suggest applying the following patch for fixing this build error on Lion.

-------------- next part --------------
A non-text attachment was scrubbed…
Name: ogl-osx.patch
Type: application/octet-stream
Size: 545 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20110902/c378d257/attachment.obj
-------------- next part --------------

/ Mattias

The OS X OpenGL header on Lion defines the GLsizeiptrARB as long if
GL_ARB_vertex_buffer_object is not defined, the SDL GL header redefines
this as another type. I suggest applying the following patch for fixing
this build error on Lion.

Whoops, I previously fixed the OpenGL 1.5 #ifdef but not the VBO one.

This is now fixed in revision control: hg changeset f31019514269 for the
1.2 branch and ab97e8ce122a for the 1.3 branch.

Thanks!

–ryan.