2016-12-14 3 views
4

私はシンプルGLFWウィンドウを作成しようとしていますし、成功するが、Xcodeのは私にエラー与える:GLFWファーストレスポンダエラー

2016-12-14 10:16:40.412191 CREngine[830:21929] [General] ERROR: Setting <GLFWContentView: 0x100369850> as the first responder for window <GLFWWindow: 0x10033ea00>, but it is in a different window ((null))! This would eventually crash when the view is freed. The first responder will be set to nil. 
(
    0 AppKit        0x00007fff9710b9a4 -[NSWindow _validateFirstResponder:] + 566 
    1 AppKit        0x00007fff968fc9eb -[NSWindow _setFirstResponder:] + 31 
    2 AppKit        0x00007fff969a466a -[NSWindow _realMakeFirstResponder:] + 406 
    3 AppKit        0x00007fff969a4480 -[NSWindow makeFirstResponder:] + 123 
    4 libglfw.3.dylib      0x00000001000a9895 _glfwPlatformCreateWindow + 631 
    5 libglfw.3.dylib      0x00000001000a5430 glfwCreateWindow + 487 
    6 CREngine       0x0000000100000e87 main + 135 
    7 libdyld.dylib      0x00007fffadd2d255 start + 1 
) 
Program ended with exit code: 0 

私が使用したコードは次のとおりです。

#include <GLFW/glfw3.h> 

int main(void) 
{ 
    GLFWwindow* window; 

    /* Initialize the library */ 
    if (!glfwInit()) 
     return -1; 

    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); 
    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2); 
    glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); 
    glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); 

    /* Create a windowed mode window and its OpenGL context */ 
    window = glfwCreateWindow(640, 480, "Hello World", NULL, NULL); 
    if (!window) 
    { 
     glfwTerminate(); 
     return -1; 
    } 

    /* Make the window's context current */ 
    glfwMakeContextCurrent(window); 

    /* Loop until the user closes the window */ 
    while (!glfwWindowShouldClose(window)) 
    { 
     /* Render here */ 
     glClear(GL_COLOR_BUFFER_BIT); 

     /* Swap front and back buffers */ 
     glfwSwapBuffers(window); 

     /* Poll for and process events */ 
     glfwPollEvents(); 
    } 

    glfwTerminate(); 
    return 0; 
} 

一部であり、私が見たことから私を混乱させることは、私が持っているヒントを含めてそれがMac上で動作することを許可することですが、何らかの理由で私はまだ誰かが私がこのエラーを解決するのを助けることができたと期待していたので、

+1

これはされているようですバグ。 GLFWの最新バージョンを実行していますか? (そして、あなたはmacOS Sierraを使っていますか?) – pingul

+0

@pingul yes on both – Matthew

+0

そしてどのバージョンのSierra?このhttps://forums.developer.apple.com/thread/49052は、リンゴの問題であることを示唆しているようです。 – pingul

答えて

4

は、これがmacOS Sierraの既知のバグであり、git-repoを見ると修正されているようです。ただし、(現在)latest version on their webpageが更新されているようには見えません。

ウェブサイトからGLFWをインストールしている場合は、コードをgitからpullしてローカルにコンパイルすることをおすすめします。

(編集:ソースからは.dylibファイルの構築についていくつかの有用な詳細についてはthisを参照)https://github.com/glfw/glfw/issues/876を見ると

関連する問題