Installing GLEW and using it with Xcode

丶灬走出姿态 提交于 2019-12-12 20:01:06

问题


So I already downloaded the lastest glew v. 1.9 from the site and make it in the terminal, what I cant figure out is how to add it successfully to a GLUT OpenGL Xcode project. I can add the OpenGl and GLUT frameworks very easily but I cant find any glew frameworks or something similar.

Main problem is that one of my files has #include GL/glew.h and it cant find it.


回答1:


While using 'Frameworks' is the Apple way of doing things, XCode will let you specify header paths and a shared library (as is the convention in Nixlike environments).

1) Go to your target's properties, 2) look for header search paths field and add your Glew headers to that. 3) Then look for the GLEW shared library (typically a '.a' or '.so' file) in the directory where you compiled GLEW. Add this directory to your target's library search paths and 4) then finally link against this library in your dependencies list.



来源:https://stackoverflow.com/questions/12518757/installing-glew-and-using-it-with-xcode

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