Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualHinchy

Posted 10 April 2012 - 04:47 PM

SDL is not a system framework. You should use quotes instead of angle brackets to include SDL, SDL_image, and SDL_mixer.

SDL has a header file for OpenGL, SDL_opengl.h, that keeps you from having to worry about how to include the OpenGL headers on various operating systems. I suggest including SDL_opengl.h instead of gl.h.

Ah, thank you. Have adjusted my code with both of these in mind.

You haven't said how you are trying to compile your code. Are you using Xcode or are you trying to compile using a makefile? If you are using a makefile, you need to link to the Cocoa framework because the Mac version of SDL uses Cocoa. You also need to add the file SDLMain.m to your Xcode project or makefile. SDLMain.m contains glue code that allows you to compile SDL code on Mac OS X.

Sorry, I'm using Xcode. I am also using SDLMain.m and linking to the cocoa framework.


After making those changes to the code and reading your SDL and OpenGL on Mac OS X article, I'm still getting errors:

Parse Issue
Unknown type name 'GLuint'

Almost all the errors are like this, sometimes replacing GLuint with other things such as Mix_Chunk and SDL_Color... basically any defined data type.

Eventually I get a "Too many errors emitted, stopping now." message.

EDIT: On clean and rebuild I've discovered SDLMain is throwing up a ton of errors related to automatic reference counting mode. I'm going to assume I should be compiling with automatic reference counting OFF -- could someone confirm this for me?

#2Hinchy

Posted 10 April 2012 - 04:46 PM

SDL is not a system framework. You should use quotes instead of angle brackets to include SDL, SDL_image, and SDL_mixer.

SDL has a header file for OpenGL, SDL_opengl.h, that keeps you from having to worry about how to include the OpenGL headers on various operating systems. I suggest including SDL_opengl.h instead of gl.h.

Ah, thank you. Have adjusted my code with both of these in mind.

You haven't said how you are trying to compile your code. Are you using Xcode or are you trying to compile using a makefile? If you are using a makefile, you need to link to the Cocoa framework because the Mac version of SDL uses Cocoa. You also need to add the file SDLMain.m to your Xcode project or makefile. SDLMain.m contains glue code that allows you to compile SDL code on Mac OS X.

Sorry, I'm using Xcode. I am also using SDLMain.m and linking to the cocoa framework.


After making those changes to the code and reading your SDL and OpenGL on Mac OS X article, I'm still getting errors:

Parse Issue
Unknown type name 'GLuint'

Almost all the errors are like this, sometimes replacing GLuint with other things such as Mix_Chunk and SDL_Color... basically any defined data type.

Eventually I get a "Too many errors emitted, stopping now." message.

EDIT: On clean and rebuild I've discovered SDLMain is throwing up a ton of errors related to automatic reference counting mode. Am I compiling with an option I'm not supposed to or something?

#1Hinchy

Posted 10 April 2012 - 04:41 PM

SDL is not a system framework. You should use quotes instead of angle brackets to include SDL, SDL_image, and SDL_mixer.

SDL has a header file for OpenGL, SDL_opengl.h, that keeps you from having to worry about how to include the OpenGL headers on various operating systems. I suggest including SDL_opengl.h instead of gl.h.

Ah, thank you. Have adjusted my code with both of these in mind.

You haven't said how you are trying to compile your code. Are you using Xcode or are you trying to compile using a makefile? If you are using a makefile, you need to link to the Cocoa framework because the Mac version of SDL uses Cocoa. You also need to add the file SDLMain.m to your Xcode project or makefile. SDLMain.m contains glue code that allows you to compile SDL code on Mac OS X.

Sorry, I'm using Xcode. I am also using SDLMain.m and linking to the cocoa framework.


After making those changes to the code and reading your SDL and OpenGL on Mac OS X article, I'm still getting errors:

Parse Issue
Unknown type name 'GLuint'

Almost all the errors are like this, sometimes replacing GLuint with other things such as Mix_Chunk and SDL_Color... basically any defined data type.

Eventually I get a "Too many errors emitted, stopping now." message.

PARTNERS