Troy
Troy

Reputation: 1

Failure to Build GLFW project in Xcode 11

I want to play around with OpenGL but I can't seem to get a basic GLFW project to build without explicit header pathnames. I imagine it comes down to a basic misunderstanding I have about Xcode 11 but I feel like I am doing everything properly.

I installed glfw3 and glew using the homebrew method. I can find the header files and dylib files in /usr/local/Cellar just fine. I can also see the shortcut folders GL/ and GLFW/ in /usr/local/include

In my Xcode project I have created a command line project. My Link Binary with Libraries section includes libglfw.3.3.dylib, libGLEW.2.1.0.dylib, and the OpenGL.framework: Link Binary with Libraries entries

My Library Search Paths has /usr/local/include as an entry.

My test program will build and run with this:

#include "/usr/local/include/GL/glew.h"
#include "/usr/local/include/GLFW/glfw3.h"

My test program will not build and run with this:

#include <GL/glew.h>
#include <GLFW/glfw3.h>

How am I failing to set this up properly?

Upvotes: 0

Views: 382

Answers (1)

Geolm
Geolm

Reputation: 61

You should add /usr/local/include in Build Settings/Search Paths/System Header Search Paths/Debug and also Release I guess.

Hope it helps.

Upvotes: 0

Related Questions