当我使用#include< OpenGL/gl.h>在我的xcode项目中,它在哪里寻找gl.h文件? [英] when I use the line #include <OpenGL/gl.h> in my xcode project, where does it look for the gl.h file?

查看:352
本文介绍了当我使用#include< OpenGL/gl.h>在我的xcode项目中,它在哪里寻找gl.h文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将linux的开源C ++程序移植到os x.我一直在改变这一点

I am porting an open source C++ program for linux to os x. I have been changing lines from this

 #include <GL/gl.h> 

对此

#include <OpenGL/gl.h>

基于这篇文章的建议:

based on the advice from this post: How do I use Open GL in a C++ project that I am porting from Linux

该更改摆脱了编译器错误,但我感到困惑:xcode/它用来查找该文件的C ++编译器在哪里?如果我搜索xcode项目,则看不到名为OpenGL的目录或文件= gl.h?

That change gets rid of the compiler errors, but I am confused: where is xcode/the C++ compiler that it uses going to look for that file? If I search my xcode project, I don't see a directory called OpenGL or a file = gl.h?

我习惯于根据.html文件的工作目录在网页中包含图片或JavaScript库. xcode在这里发生了其他事情.

I'm used to including images or javascript libraries in web pages based on the working directory of the .html file. Something else is happening in xcode here.

推荐答案

在Mac上,您将从OpenGL框架中获得这些标头.标头位于:

On a Mac, you'll get those headers from the OpenGL framework. The headers are located at:

/System/Library/Frameworks/OpenGL.framework/Headers

严格来说,该路径是符号链接-实际位置是:

Strictly speaking, that path is a symbolic link - the real location is:

/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers

如果您在编译器/链接器命令行中通过-framework OpenGL,您的工具链将能够找到它们.

Your toolchain will be able to find them if you pass -framework OpenGL on the compiler/linker command lines.

这篇关于当我使用#include&lt; OpenGL/gl.h&gt;在我的xcode项目中,它在哪里寻找gl.h文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆