3

我试图找出一个较旧的 python 项目中的构建错误,我完全被难住了。该项目需要一个要链接的库OpenGL,setup.py 通过将-framework OpenGL标志传递给 clang 的链接阶段来实现。我的系统正在运行 10.9.2 和 XCode 5.1。C 文件中的包含行是:

#include <OpenGL/glu.h>

调用clang和产生的错误是:

/usr/bin/clang -bundle -undefined dynamic_lookup -L/opt/local/lib -Wl,-headerpad_max_install_names -L/opt/local/lib/db46 build/temp.macosx-10.9-x86_64-2.7/src/visual/_polyobject.o -o build/lib.macosx-10.9-x86_64-2.7/trep/visual/_polyobject.so -framework OpenGL

clang: error: unknown argument: '-framework OpenGL' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: command '/usr/bin/clang' failed with exit status 1

现在是奇怪的部分。对 clang的完全相同的调用,但从一个 shell 脚本完成,运行得很好,并且正确链接了库,没有错误或警告。运行clang --help没有帮助,因为它-framework甚至没有将选项描述为有效参数。有没有人知道这里发生了什么?为什么 clang 的行为会根据它是从 python 脚本还是 shell 脚本调用而有所不同?

4

0 回答 0