xcode GLEW:Apple Mach-O 链接器 (Id) 错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9064379/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
GLEW: Apple Mach-O Linker (Id) Error
提问by bjz
I'm trying to use glew in my Xcode project, but I'm getting this: Apple Mach-O Linker (Id) Error... Undefined symbols for architecture x86_64
我试图在我的 Xcode 项目中使用 glew,但我得到了这个: Apple Mach-O Linker (Id) Error... Undefined symbols for architecture x86_64
I'm using the current version of glew that I downloaded from their sourceforge site.
我正在使用从他们的sourceforge 站点下载的当前版本的glew 。
回答by bjz
Here's what I did:
这是我所做的:
Install Glew via MacPorts. (in terminal run the command sudo port install glew
)
通过 MacPorts 安装 Glew。(在终端运行命令sudo port install glew
)
In the Xcode project's build settings add the following:
在 Xcode 项目的构建设置中添加以下内容:
- other linker flags:
-lGLEW
- header search paths:
/opt/local/include/
- library search paths:
/opt/local/lib/
- 其他链接器标志:
-lGLEW
- 标题搜索路径:
/opt/local/include/
- 图书馆搜索路径:
/opt/local/lib/
回答by trojanfoe
You aren't linking with the GLEW library. You will probably have to add the directory, you installed GLES into, it to the 'library search path' settings of the Xcode project.
您没有与 GLEW 库链接。您可能必须将安装 GLES 的目录添加到 Xcode 项目的“库搜索路径”设置中。