如何使用Xcode中的OpenGL程序解决以下链接器错误?

时间:2013-01-13 14:18:57

标签: macos opengl

当我尝试在Mac OS 10.8上的Xcode中编译我的C ++ OpenGL程序时,我收到以下错误......我该怎么办?

Undefined symbols for architecture x86_64:
  "_aglChoosePixelFormat", referenced from:
      _main in main.o
  "_aglCreateContext", referenced from:
      _main in main.o
  "_aglDestroyContext", referenced from:
      _main in main.o
  "_aglDestroyPixelFormat", referenced from:
      _main in main.o
  "_aglSetCurrentContext", referenced from:
      _main in main.o
  "_aglSetFullScreen", referenced from:
      _main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

1 个答案:

答案 0 :(得分:1)

由于您正在使用AGL,查看AGL的引用,您需要将框架AGL与OpenGL一起导入。