Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to link glew in xcode

I can't link glew with xcode. I have glew library is located in /usr/local/lib/libGLEW.dylib

When i compile file in command line all right:

g++ /usr/local/lib/libGLEW.dylib -framework OpenGL main.cpp

But when i compile in xcode, i get error:

'GL/glew.h' file not found

Code:

#include <iostream>
#include <GL/glew.h>

int main(int argc, const char * argv[])
{
    // insert code here...
    std::cout << "Hello, World!\n";
    return 0;
}

Im linked glew with xcode

there screenshot

OS X 10.8.4, Xcode 4.6.1

like image 873
user2417329 Avatar asked Jul 11 '13 18:07

user2417329


1 Answers

Adding the library only handles the binary linking. You need to configure Xcode so it can also find the headers describing the contents of the binary.

In Xcode Project Settings search for: Header Search Paths

Add the path to the headers for GLEW (probably near the same folder as the library maybe /usr/local/include). Change the import to match. It should be #include <glew.h> (or #include <GL/glew.h>) if the path gets setup correctly.

For Xcode beginners, here is a screenshot:

screenshot

like image 163
Justin Meiners Avatar answered Sep 21 '22 15:09

Justin Meiners