在Mac上使用命令行构建OpenGL应用时链接错误

时间:2020-04-25 02:16:15

标签: macos opengl glfw

我是Mac上构建命令行的新手。在使用OpenGL,IMGui和GLFW开发跨平台应用程序时,我不断遇到链接错误:

    Undefined symbols for architecture x86_64:
  "__glfwCreateContextEGL", referenced from:
      __glfwPlatformCreateWindow in libGLFW.a(cocoa_window.o)
  "__glfwCreateContextNSGL", referenced from:
      __glfwPlatformCreateWindow in libGLFW.a(cocoa_window.o)
  "__glfwCreateContextOSMesa", referenced from:
      __glfwPlatformCreateWindow in libGLFW.a(cocoa_window.o)
  "__glfwInitEGL", referenced from:
      __glfwPlatformCreateWindow in libGLFW.a(cocoa_window.o)
  "__glfwInitNSGL", referenced from:
      __glfwPlatformCreateWindow in libGLFW.a(cocoa_window.o)
  "__glfwInitOSMesa", referenced from:
      __glfwPlatformCreateWindow in libGLFW.a(cocoa_window.o)
  "__glfwPlatformCreateMutex", referenced from:
      _glfwInit in libGLFW.a(init.o)
  "__glfwPlatformCreateTls", referenced from:
      _glfwInit in libGLFW.a(init.o)
  "__glfwPlatformDestroyMutex", referenced from:
      _terminate in libGLFW.a(init.o)
  "__glfwPlatformDestroyTls", referenced from:
      _terminate in libGLFW.a(init.o)
  "__glfwPlatformGetTls", referenced from:
      _glfwDestroyWindow in libGLFW.a(window.o)
      __glfwRefreshContextAttribs in libGLFW.a(context.o)
      _glfwMakeContextCurrent in libGLFW.a(context.o)
      _glfwExtensionSupported in libGLFW.a(context.o)
      _glfwGetCurrentContext in libGLFW.a(context.o)
      _glfwSwapInterval in libGLFW.a(context.o)
      _glfwGetProcAddress in libGLFW.a(context.o)
      ...
  "__glfwPlatformLockMutex", referenced from:
      __glfwInputError in libGLFW.a(init.o)
  "__glfwPlatformSetTls", referenced from:
      __glfwInputError in libGLFW.a(init.o)
      _glfwInit in libGLFW.a(init.o)
  "__glfwPlatformUnlockMutex", referenced from:
      __glfwInputError in libGLFW.a(init.o)
  "__glfwTerminateNSGL", referenced from:
      __glfwPlatformTerminate in libGLFW.a(cocoa_init.o)
  "__glfwUpdateDisplayLinkDisplayNSGL", referenced from:
      -[GLFWWindowDelegate windowDidChangeScreen:] in libGLFW.a(cocoa_window.o)

我正在链接到Cocoa,CoreVideo和IOKit框架。知道我缺少什么吗?

0 个答案:

没有答案