__glewX* Undefined Symbols in XQuartz Build

拜拜、爱过 提交于 2019-12-11 20:18:43

问题


​I am trying to compile an X11 application on Mac OS X using XQuartz (i.e. XQuartz provides an X11 implementation, so the code should compile directly).

The X11 code, however, is sophisticated enough to require OpenGL extensions through GLEW. This almost works, but a few symbols remain undefined. Here's the relevant, cleaned-up output of the verbose link:

"/usr/bin/ld" [flags] -o [out] [lib-dirs] [obj-file] [CustomLib2 CustomLib1] -lX11.6 -lGLEW -lGLEW.1.10 -lc++ -lstdc++ -lSystem /usr/bin/../lib/clang/4.2/lib/darwin/libclang_rt.osx.a
Undefined symbols for architecture x86_64:
  "___glewXChooseFBConfig", referenced from: [place in CustomLib2]
  "___glewXCreateContextAttribsARB", referenced from: [place in CustomLib2]
  "___glewXSwapIntervalEXT", referenced from: [place in CustomLib2]

I checked the libraries, and they don't have any __glewX* symbols (though they have lots of __glew* symbols), despite this suggesting they should be there. I.e., these commands both come up empty:

nm /usr/lib/libGLEW.a | grep __glewX
nm /usr/lib/libGLEW.1.10.0.dylib | grep __glewX

My question: where are the __glewX* symbols located?

N.B. I am not using XCode or CMake. This is a simple makefile build.

来源:https://stackoverflow.com/questions/27813935/glewx-undefined-symbols-in-xquartz-build

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!