相关疑难解决方法(0)

glewInit()在macOS上失败

所以我有一段代码在ubuntu机器上运行良好,但在xcode或终端上没有这样做.我正在尝试在xcode上运行它,但它在main上失败:

"使用未声明的标识符glewInit;你的意思是glutInit吗?" "函数调用的参数太少,预期2,有0"

代码冗长是由我的教授编写的,它运行在ubuntus上.但是由于这些错误,我认为原因是......好吧,明确的标识符,包括缺失.因此,在谷歌搜索之后我发现glewInit是glew库的一部分 - >所以我下载了代码并将其安装在我的机器上,其中包括:

make sudo -s make install

已成功安装到我的/ usr/include/GL中.现在,当我输入xcode #include或只是#include时,编译器抛出找不到glew.h(虽然我可以在usr/include/GL中看到自己的文件).

这是代码:

#include "include/Angel.h"

// The rotation  around z axis
GLfloat  Theta = 0.0; // Angle (in degrees)
GLfloat  step = 0.01; // Incremental
GLuint  locTheta;  
enum { CW = 0, CCW = 1};
int direction = CW;  // Direction

//Scale along x and y axes
GLfloat ScaleFactor[2] = {1.0, 1.0};
GLuint locScale;

const int NumPoints = 4;
void init();
void display( void );
void reshape( GLsizei …
Run Code Online (Sandbox Code Playgroud)

c++ opengl osx-lion

6
推荐指数
1
解决办法
4834
查看次数

标签 统计

c++ ×1

opengl ×1

osx-lion ×1