Compiling with GLFW3, linker errors 'undefined reference'

前端 未结 2 1891
攒了一身酷
攒了一身酷 2021-01-01 04:34

Having a minimal example using GLFW3:

#include 

int main(int argc, const char * argv[]) {
    glfwInit();
}
相关标签:
2条回答
  • 2021-01-01 04:52

    In Mac OS X, glfw3 uses Cocoa (NSGL) for its OpenGL context management. glfw2 used Carbon (CGL/AGL, depending on fullscreen or windowed mode).

    NSGL is more robust, but it is built upon an Objective C framework (Cocoa). In order for your software to work correctly with glfw3, you should include the Cocoa framework.

    0 讨论(0)
  • 2021-01-01 04:57

    If you are using the static library version of GLFW, add it and the Cocoa, OpenGL, IOKit and CoreVideo frameworks to the project as dependencies.

    0 讨论(0)
提交回复
热议问题