简体   繁体   中英

I'm having trouble linking the GLEW library to my Xcode Project

I'm currently trying to follow the OpenGL intro guide here . I've pulled the finished project straight from the git repo on the site into a new Xcode project, but upon trying to build and run I get a "GL/glew.h: No such file or directory".

I've downloaded glew from the site, and run "make" and "make install". I can see 3 libGLEW files in /usr/lib, and 3 header glew related header files in /usr/include/GL. This all leads me to believe it's installed fine.

Following a couple of ideas from googling, I tried adding the /usr/lib and /usr/include/GL paths to the relevant search paths in the project info, but that still gave the same problem. I also tried adding "-lGLEW" to the 'Other Linker Flags' option.

The include in the C source is simply

#include <GL/glew.h>

What am I missing?! Thanks for any help

Accepted answer works, the recursive box in XCode also needs to be checked.

If you #include it using #include then the search path has to be simply /usr/include . Try adding /usr/include to your header search paths in your Xcode project and then it should be able to find the header.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM