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

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

问题描述

一些上下文:我正在阅读有关使用 OpenGL 的教程.本教程需要几个库才能工作.这些库之一是 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 并按照说明进行安装,但是当我运行make all"时命令我收到此错误:

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天全站免登陆