c - MAC 10.7:gl.h 文件在哪里?

c - MAC 10.7:gl.h 文件在哪里?

可能重复:

Mac OS X Lion 上的 FreeGLUT

第一个测验:谁能解释一下为什么我无法在我的mac上的任何地方找到gl.h文件?!如果可以简单地回答这个问题,也许您甚至不必阅读其余部分,但是我在网上找不到任何答案(经过数小时的研究),除了著名的“它已集成到操作系统中”或类似的东西。

我的问题详细:

我在使用 OpenGL 编译 .c 文件时遇到问题。我已经浏览了几个小时的网页,但没有找到任何解决方案。这是问题所在:

对于那些知道这个软件的人,我正在使用 Webots(一个机器人模拟软件),我想实现一个物理插件。我从一个已经存在的(和工作的)插件中复制了代码,只是为了尝试一下。我正在使用使用 gcc 的 webbots 进行编译(我必须安装 gcc 编译器,因为它不再随 Xcode 提供)。

现在,问题是 .c 文件包含一个“physics.h”标头,其中包含 OpenGL/gl.h 文件,然后我得到错误:“OpenGL/gl.h。没有这样的文件或目录”。

现在我尝试了很多事情:

搜索 gl.h :它似乎不存在(我无法找到它,无论是手动还是使用 finder 搜索功能)

用 GLUT/glut.h 替换包含 OpenGL/gl.h :我收到错误“gl.h 和 glu.h 没有这样的文件或目录”,因为它们包含在 glut.h

链接makefile中的gl库和框架

可能是这些的所有组合,使用绝对或相对路径!

由于 OpenGL 和 GLUT 应该与 OS 一起本地安装(我正在使用 Lion 10.7.5),我想每个需要的文件都应该在那里。为此,我找不到下载这个据称丢失的文件的方法......

此外,我的一位同事尝试并成功在 linux 上编译它!Linux 是一个很棒的平台,但我仍然喜欢我的 mac,所以请让我希望有另一种解决方案,而不是为 linux 更改!!!

我认为我的问题出在 Makefile 或 physic.h 文件中,所以它们是:

Physic.h:

#ifndef PHYSICS_H

#define PHYSICS_H

#include

#ifdef WIN32

#include

#endif

#ifndef MACOS

#include

#else

#include

#endif

/* callback functions to be implemented in your physics plugin */

#ifdef __cplusplus

extern "C" {

#endif

#ifdef _MSC_VER

#define DLLEXPORT __declspec(dllexport)

#else

#define DLLEXPORT

#endif

DLLEXPORT void webots_physics_init(dWorldID,dSpaceID,dJointGroupID);

DLLEXPORT int webots_physics_collide(dGeomID,dGeomID);

DLLEXPORT void webots_physics_step();

DLLEXPORT void webots_physics_step_end();

DLLEXPORT void webots_physics_cleanup();

DLLEXPORT void webots_physics_draw();

DLLEXPORT void webots_physics_predraw();

/* utility functions to be used in your callback functions */

#ifndef LINUX

extern dGeomID (*dWebotsGetGeomFromDEFProc)(const char *);

extern dBodyID (*dWebotsGetBodyFromDEFProc)(const char *);

extern void (*dWebotsSendProc)(int,const void *,int);

extern void* (*dWebotsReceiveProc)(int *);

extern void (*dWebotsConsolePrintfProc)(const char *, ...);

extern double (*dWebotsGetTimeProc)();

#define dWebotsGetGeomFromDEF(DEFName) (*dWebotsGetGeomFromDEFProc)(DEFName)

#define dWebotsGetBodyFromDEF(DEFName) (*dWebotsGetBodyFromDEFProc)(DEFName)

#define dWebotsSend(channel,buff,size) (*dWebotsSendProc)(channel,buff,size)

#define dWebotsReceive(size_ptr) (*dWebotsReceiveProc)(size_ptr)

#if defined(__VISUALC__) || defined (_MSC_VER) || defined(__BORLANDC__)

#define dWebotsConsolePrintf(format, ...) (*dWebotsConsolePrintfProc)(format, __VA_ARGS__)

#else

#define dWebotsConsolePrintf(format, ...) (*dWebotsConsolePrintfProc)(format, ## __VA_ARGS__)

#endif

#define dWebotsGetTime() (*dWebotsGetTimeProc)()

#else

dGeomID dWebotsGetGeomFromDEF(const char *DEFName);

dBodyID dWebotsGetBodyFromDEF(const char *DEFName);

void dWebotsSend(int channel,const void *buffer,int size);

void *dWebotsReceive(int *size);

void dWebotsConsolePrintf(const char *format, ...);

double dWebotsGetTime();

#endif

#ifdef __cplusplus

}

#endif

#endif /* PHYSICS_H */

生成文件:

###

### Standard Makefile for Webots physics plugins

###

### Supported platforms: Windows, Mac OS X, Linux

### Supported languages: C, C++

###

### Authors: Olivier Michel - www.cyberbotics.com

### Revised: Yvan Bourquin - September 30th, 2009.

###

### Uncomment the variables to customize the Makefile

### -----C Sources-----

###

### if your plugin uses several C source files:

C_SOURCES = my_contact_p_physics.c

### -----C++ Sources-----

###

### if your plugin uses several C++ source files:

# CPP_SOURCES = my_plugin.cpp my_clever_algo.cpp my_graphics.cpp

### or

# CC_SOURCES = my_plugin.cc my_clever_algo.cc my_graphics.cc

FRAMEWORK = -framework OpenGL -framework GLUT

### -----Options-----

###

### if special CFLAGS are necessary, for example to set optimization level or

### to find include files:

#CFLAGS=-O3 -I/System/Library/Frameworks/OpenGL.framework

###

### if your plugin needs additional libraries:

LIBRARIES=-L/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries -llibGL -llibGLU

### Do not modify: this includes Webots global Makefile.include

space :=

space +=

WEBOTS_HOME_PATH=$(subst $(space),\ ,$(strip $(subst \,/,$(WEBOTS_HOME))))

include $(WEBOTS_HOME_PATH)/resources/projects/default/plugins/physics/Makefile.include

PS:在“my_contact_p_physics.c”(我正在努力编译的 .c 文件)中,我只包含一个 ODE/ode.h 文件和带有绝对路径的physics.h 文件。由于“集成”到 webbots 中的 ODE,我无法在终端中直接编译,这也是我直接在 webbots 中编译的原因。

相关推荐

植物繁殖
365速发平台app下载

植物繁殖

⌛ 07-26 👁️ 5513
请问vxworks的价格是?
BT365软件提现不了

请问vxworks的价格是?

⌛ 07-10 👁️ 7398
秾五笔怎么打
365速发平台app下载

秾五笔怎么打

⌛ 06-30 👁️ 738