Menus and cmd+q not firing SDL_QUIT event on mac os x

As the title suggests, i’m not able to quit my game properly on os x as i can’t seem to get quit in the menu or cmd+q to work. Closing the window via the red button does work though.

Anyone got any tips on this? I’m not exactly a mac expert and it could be that i’m missing something i need to include. I’m linking to the cocoa, sdl2 2.0.7 (latest) and opengl frameworks. It’s being compied as a c++ app.

I’m using osx 10.11.6 with xcode version 7.1

I had a search around on google and couldn’t see anything specific in this area.

Also, i couldn’t get SDL_main to work, which may also be an issue.

Any tips?

Cheers
Charlie