简体   繁体   中英

# include <GL/glut.h> File Not Found in Xcode

I am trying to run an openGL program in Xcode, but I am getting an error in one line of the following code:

#ifdef __MAC__
# include <GLUT/glut.h>
#else
# include <GL/glut.h>   // in this line, I am getting the error that the file is not found
#endif

I have added the GLUT framework and openGL framework - not sure if this is related).

If I get that error.I will write the bellow. This way is only works OSX.

#ifndef __MAC__
#define __MAC__ 1
#endif

#ifdef __MAC__
# include <GLUT/glut.h>
#else
# include <GL/glut.h>   // in this line, I am getting the error that the file is not found
#endif

Use <GLUT/glut.h> instead of <GL/glut.h> on all platforms.

The former has been deprecated in the latest updates and you might receive warnings.

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