You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reported in version: 1.2.14 Reported for operating system, platform: Mac OS X 10.6, Other
Comments on the original bug report:
On 2010-10-20 13:22:52 +0000, Marc L wrote:
Created attachment 540
gdb backtrace
When trying a very simple SDL test program it fails with a traceback saying:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Error (1002) creating CGSWindow'
*** call stack here
terminate called after throwing an instance of 'NSException'
I've attached the gdb backtrace, and the test code is the following:
On 2010-12-20 14:26:45 +0000, Toomas Laasik wrote:
Created attachment 551
Fixed version of submitted file
On 2010-12-21 03:11:05 +0000, Toomas Laasik wrote:
I think that this is technically not a bug, but just the way how SDL works.
To fix the submitted case you have to do 2 things:
#include <SDL/SDL.h> before main
add linker flag -Wl,-framework,Cocoa
(it is a also good idea to exit gracefully with SDL_Quit)
SDL uses C preprocessor to redefine keyword "main". This is how it grabs control before any of your code executes and also makes program entry point cross-platform (eg windows had WinMain for graphical apps, but you still use main in SDL as entry point). The redefined main on OSX runs code that prepares native Cocoa framework for creating window (a bunch of NS... calls). If you manage to put main before you include SDL.h, then you'll get those "NS not properly initialized"-type errors.
The text was updated successfully, but these errors were encountered:
This bug report was migrated from our old Bugzilla tracker.
These attachments are available in the static archive:
Reported in version: 1.2.14
Reported for operating system, platform: Mac OS X 10.6, Other
Comments on the original bug report:
On 2010-10-20 13:22:52 +0000, Marc L wrote:
On 2010-12-20 14:26:45 +0000, Toomas Laasik wrote:
On 2010-12-21 03:11:05 +0000, Toomas Laasik wrote:
The text was updated successfully, but these errors were encountered: