即使存在定义,架构的未定义符号?

时间:2018-04-14 03:06:48

标签: c++ opengl graphics

出于某种原因,我不断收到错误:

Undefined symbols for architecture x86_64:  
"___glewGetUniformLocation", referenced from:      
     changePerspective(unsigned int) in Viewing-ff0c66.o 

"___glewUniformMatrix4fv", referenced from:
      changePerspective(unsigned int) in Viewing-ff0c66.o
ld: symbol(s) not found for architecture x86_64 

即使我有正确的库:

#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <GL/glut.h>
#include <OpenGL/gl.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp> 


glm::mat4 perspective(1.0f); 
glm::mat4 transform(1.0f); 
glm::mat4 camera(1.0f); 

void changePerspective(GLuint program) { 


    glUniformMatrix4fv(glGetUniformLocation(program, "matrixThingy"),1,GL_FALSE,glm::value_ptr(perspective* camera* transform)); 
}

我尝试重新下载软件并在执行时添加各种链接器选项,但我似乎无法让它工作。任何人都知道如何解决这个问题?

0 个答案:

没有答案