我试图在Java/LWJGL中制作一个简单的游戏.我正在关注在Windows上制作的教程,我正在使用mac.我抄他的代码打开了一个窗口,字符中的字符和程序崩溃立刻给了我一个非常漫长而奇怪的错误,可能有事情做与指针(其实我不知道).以下是创建窗口的行,我在其中使用了属性中定义宽度和高度的窗口:
window = glfwCreateWindow(width, height, "Flappy Bird", NULL, NULL);
Run Code Online (Sandbox Code Playgroud)
当我在我的Mac上运行它时,它给了我这个错误:
2015-10-12 13:18:38.475 java[496:31875] *** Assertion failure in + [NSUndoManager _endTopLevelGroupings], /SourceCache/Foundation/Foundation-1154/Misc.subproj/NSUndoManager.m:340
2015-10-12 13:18:38.476 java[496:31875] +[NSUndoManager(NSInternal) _endTopLevelGroupings] is only safe to invoke on the main thread.
2015-10-12 13:18:38.476 java[496:31875] (
0 CoreFoundation 0x00007fff98c3003c __exceptionPreprocess + 172
1 libobjc.A.dylib 0x00007fff9620a76e objc_exception_throw + 43
2 CoreFoundation 0x00007fff98c2fe1a +[NSException raise:format:arguments:] + 106
3 Foundation 0x00007fff99f6199b -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195
4 Foundation 0x00007fff99ee364f +[NSUndoManager(NSPrivate) _endTopLevelGroupings] + 156
5 AppKit 0x00007fff96ecbb95 -[NSApplication run] + 756
6 …Run Code Online (Sandbox Code Playgroud)