Mac OS X Lion上的FreeGLUT [英] FreeGLUT on Mac OS X Lion

查看:226
本文介绍了Mac OS X Lion上的FreeGLUT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

某些情况:我正在使用教程.本教程需要几个库才能工作.这些库之一是FreeGLUT.我在OS X上使用Lion.

Some context: I am going through a tutorial on using OpenGL. The tutorial requires a couple libraries in order to work. One of those libraries is FreeGLUT. I am on OS X using Lion.

我已经下载了FreeGLUT,并按照说明进行了安装,但是当我运行全部制作"时,命令我得到这个错误:

I've downloaded FreeGLUT and followed the instructions for installation, but when I run the 'make all' command I get this error:

error: GL/gl.h: No such file or directory
error: GL/glu.h: No such file or directory

我在互联网上搜寻了一个解决方案,据此我能理解的是,编译器在查找这些文件时遇到了麻烦,并且需要更改编译器使用的路径.

I've scoured the internet for a solution and all I've been able to understand from this is that the compiler is having trouble locating these files and that the path that the compiler is using needs to be changed.

好的,我发现它不是编译器,原因是这些文件不存在.要尝试弄清楚为什么他们不在那里.

Okay, I've figured out that it's not the compiler, it is that for some reason those files are not there. Going to try figure out why they are not there.

推荐答案

在Mac上,这些头文件的位置与Linux上的位置不同.因此,在代码中,替换为:

On Mac, the location of those header files are not the same as on Linux. So in the code, replace this:

#include <GL/gl.h>
#include <GL/glu.h>

与此:

#include <OpenGL/gl.h>
#include <OpenGL/glu.h>

这应该可以解决您的问题.

and that should fix your issue.

这篇关于Mac OS X Lion上的FreeGLUT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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