我的卷渲染代码在窗口7中工作正常但是当我尝试迁移Ubuntu 14.04时, 有编译错误。有谁能够帮我?在我的系统中,已经安装了glew glut gl glu库。
生成文件:
CC = g++
OFLAG = -o
CFLAGS = -c -Wall -g -DDEBUG
LIB = -lGLEW -lglut -lGL -lGLU
LIB_DIR = -L"./lib"
INC_DIR = -I"./include"
all: main.o
$(CC) $(OFLAG) main main.o $(LIB_DIR) $(LIB)
main.o: main.cpp
$(CC) $(CFLAGS) main.cpp $(INC_DIR)
clean:
rm main.o main
=============================================== ===================
g++ -c -Wall -g -DDEBUG main.cpp -I"./include"
In file included from ./include/GL/glew.h:1180:0,
from main.cpp:3:
./include/GL/glu.h:68:79: error: expected ‘)’ before ‘*’ token
void APIENTRY gluQuadricCallback(GLUquadric *qobj,GLenum which,void (CALLBACK *fn)());
^
./include/GL/glu.h:68:79: error: expected ‘)’ before ‘*’ token
./include/GL/glu.h:68:79: error: expected initializer before ‘*’ token
./include/GL/glu.h:78:79: error: expected ‘)’ before ‘*’ token
void APIENTRY gluTessCallback(GLUtesselator *tess,GLenum which,void (CALLBACK *fn)());
^
./include/GL/glu.h:78:79: error: expected ‘)’ before ‘*’ token
./include/GL/glu.h:78:79: error: expected initializer before ‘*’ token
./include/GL/glu.h:94:75: error: expected ‘)’ before ‘*’ token
void APIENTRY gluNurbsCallback(GLUnurbs *nobj,GLenum which,void (CALLBACK *fn)());
^
./include/GL/glu.h:94:75: error: expected ‘)’ before ‘*’ token
./include/GL/glu.h:94:75: error: expected initializer before ‘*’ token
./include/GL/glu.h:96:24: error: expected ‘)’ before ‘*’ token
typedef void (CALLBACK *GLUquadricErrorProc)(GLenum);
^
./include/GL/glu.h:97:24: error: expected ‘)’ before ‘*’ token
typedef void (CALLBACK *GLUtessBeginProc)(GLenum);
^
./include/GL/glu.h:98:24: error: expected ‘)’ before ‘*’ token
typedef void (CALLBACK *GLUtessEdgeFlagProc) (GLboolean);
^
./include/GL/glu.h:99:24: error: expected ‘)’ before ‘*’ token
typedef void (CALLBACK *GLUtessVertexProc)(void *);
^
./include/GL/glu.h:100:24: error: expected ‘)’ before ‘*’ token
typedef void (CALLBACK *GLUtessEndProc)(void);
^
./include/GL/glu.h:101:24: error: expected ‘)’ before ‘*’ token
typedef void (CALLBACK *GLUtessErrorProc)(GLenum);
^
./include/GL/glu.h:102:24: error: expected ‘)’ before ‘*’ token
typedef void (CALLBACK *GLUtessCombineProc)(GLdouble[3],void*[4],GLfloat[4],void**);
^
./include/GL/glu.h:103:24: error: expected ‘)’ before ‘*’ token
typedef void (CALLBACK *GLUtessBeginDataProc)(GLenum,void *);
^
./include/GL/glu.h:104:24: error: expected ‘)’ before ‘*’ token
typedef void (CALLBACK *GLUtessEdgeFlagDataProc) (GLboolean,void *);
^
./include/GL/glu.h:105:24: error: expected ‘)’ before ‘*’ token
typedef void (CALLBACK *GLUtessVertexDataProc)(void *,void *);
^
./include/GL/glu.h:106:24: error: expected ‘)’ before ‘*’ token
typedef void (CALLBACK *GLUtessEndDataProc)(void *);
^
./include/GL/glu.h:107:24: error: expected ‘)’ before ‘*’ token
typedef void (CALLBACK *GLUtessErrorDataProc)(GLenum,void *);
^
./include/GL/glu.h:108:24: error: expected ‘)’ before ‘*’ token
typedef void (CALLBACK *GLUtessCombineDataProc)(GLdouble[3],void*[4],GLfloat[4],void**,void*);
^
./include/GL/glu.h:109:24: error: expected ‘)’ before ‘*’ token
typedef void (CALLBACK *GLUnurbsErrorProc)(GLenum);
^
make: *** [main.o] Error 1
=============================================== ===============
#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glext.h>
#include <GL/glut.h>
#define GLM_FORCE_RADIANS
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtx/transform2.hpp>
#include <cerrno>
#include <cstdio>
#include <cstdlib>
#include <fstream>
#include <iostream>
using namespace std;
using glm::mat4;
using glm::vec3;