Xcode Can't find freeglut

Started by
1 comment, last by aregee 9 years, 8 months ago

I installed free glut and flew using MacPort. Then, i followed the instructions on Lazy foo for setting up the linker and lib and includes.

When i use

#include <OpenGL/freeglut.h>

It can't find the file.

Is there a different set of instructions for setting up Xcode when I use MacPort?

Advertisement

nvm got an answer on OpenGL forum :)

Nice to post the answer here for future reference too, but I am guessing it is about telling Xcode which folder to search for include files and library files, which often is located in '/usr/local/include' and '/usr/local/lib', after you have compiled the library or something.

The settings in Xcode are called "User Header Search Paths" and for some reason I have set "Framework Search Paths" for library files. Not sure why I did that, and not used "Library Search Paths", but it works in my project.

EDIT:

Just came up with two more pitfalls: if you specify a path too deep, you may have to specify the include like this:

#include "freeglut.h"

instead of:

#include "OpenGL/freeglut.h"

Also, if you don't check the "recursive" option, subfolders won't be scanned, so you won't find the include files anyway if they are one level deeper. (May not always apply, if you specify right folder, and it is flat.)

This topic is closed to new replies.

Advertisement