2013-12-21 1 views
0

이 코드로 인해 식별자 GLUquadric에 대한 오류가 발생하는 이유는 무엇입니까? 내가 아는 한 GLFW 포함은 그것을 범위로 가져와야합니다.오류 CC2061 : 구문 오류 : 식별자 'GLUquadric'

#ifndef BALL_H 
#define BALL_H 

#define GLFW_INCLUDE_GLU 
#include <GLFW/glfw3.h> 

#include <glm/glm.hpp> 
#include <glm/ext.hpp> 

struct Cuboid; 

struct Ball { 
    glm::vec3 position; 
    glm::vec3 velocity; 
    float radius; 

    glm::quat orientation; 
    glm::vec3 angular_velocity; 

    Ball(float radius); 
}; 

void draw(const Ball& ball, GLUquadric* quadric); 
void integrate(Ball& ball, float dt, const Cuboid& platform, glm::vec3 torque); 

#endif 
+0

질문을 업데이트하여 정확한 오류 메시지를 정확하게 표시하십시오. –

답변

0

나는 해결책을 직접 찾아 냈다. (게시 한 파일)이 이미 GLFW/glfw3.h에 포함되어 있지만. #define GLFW_INCLUDE_GLU을 미리 포함하지 않은 .cpp 파일 인 것 같습니다. 나는이 .CPP 파일에 정의 추가하여 그것을 해결,하지만 난 어쩌면 내가 더 좋은 솔루션을 내 자신의 헤더, opengl.h을 수행 할 수 있다고 가정합니다

#ifndef OPENGL_H 
#define OPENGL_H 

#define GLFW_INCLUDE_GLU 
#include <GLFW/glfw3.h> 

#endif 

그리고 다음을 포함하는 대신 GLFW/glfw3.h 그.