我正在编译一个包含 c++ 文件和头文件的目录。我以为我正确安装了 openGL、Glut 和 Glew,但是在运行它时我不断收到引用错误。
这是我正在做的事情以及编译器发回给我的错误:
user@Linux-machine:~/Documents/HW$ make
g++ -g framework.o poly_line.o shader_program.o circle.o controller.o main.o scene.o view.o -lGLEW -lglut -lGLU -o HW
framework.cpp:84: error: undefined reference to 'glGetError'
check_gl.h:30: error: undefined reference to 'glGetError'
check_gl.h:43: error: undefined reference to 'glGetError'
poly_line.cpp:23: error: undefined reference to 'glGenBuffers'
poly_line.cpp:28: error: undefined reference to 'glBindBuffer'
poly_line.cpp:29: error: undefined reference to 'glBufferData'
poly_line.cpp:54: error: undefined reference to 'glEnable'
poly_line.cpp:55: error: undefined reference to 'glEnable'
poly_line.cpp:56: error: undefined reference to 'glBlendFunc'
poly_line.cpp:57: error: undefined reference to 'glHint'
poly_line.cpp:59: error: undefined reference to 'glDisable'
poly_line.cpp:60: error: undefined reference to 'glDisable'
poly_line.cpp:68: error: undefined reference to 'glBindBuffer'
poly_line.cpp:69: error: undefined reference to 'glEnableVertexAttribArray'
poly_line.cpp:70: error: undefined reference to 'glVertexAttribPointer'
poly_line.cpp:78: error: undefined reference to 'glDrawArrays'
poly_line.cpp:80: error: undefined reference to 'glDrawArrays'
shader_program.cpp:104: error: undefined reference to 'glCreateProgram'
shader_program.cpp:113: error: undefined reference to 'glGetProgramiv'
shader_program.cpp:115: error: undefined reference to 'glGetProgramiv'
shader_program.cpp:120: error: undefined reference to 'glGetProgramInfoLog'
shader_program.cpp:135: error: undefined reference to 'glGetShaderiv'
shader_program.cpp:137: error: undefined reference to 'glGetShaderiv'
shader_program.cpp:142: error: undefined reference to 'glGetShaderInfoLog'
shader_program.cpp:155: error: undefined reference to 'glDeleteShader'
shader_program.cpp:163: error: undefined reference to 'glDeleteShader'
shader_program.cpp:185: error: undefined reference to 'glCreateShader'
shader_program.cpp:195: error: undefined reference to 'glShaderSource'
shader_program.cpp:200: error: undefined reference to 'glCompileShader'
shader_program.cpp:214: error: undefined reference to 'glAttachShader'
shader_program.cpp:219: error: undefined reference to 'glLinkProgram'
shader_program.cpp:238: error: undefined reference to 'glUseProgram'
shader_program.cpp:249: error: undefined reference to 'glUniform1f'
shader_program.cpp:257: error: undefined reference to 'glUniform1i'
shader_program.cpp:270: error: undefined reference to 'glGetUniformLocation'
shader_program.cpp:290: error: undefined reference to 'glUseProgram'
shader_program.cpp:304: error: undefined reference to 'glGetProgramiv'
shader_program.cpp:308: error: undefined reference to 'glGetProgramiv'
shader_program.cpp:315: error: undefined reference to 'glGetActiveUniform'
view.cpp:28: error: undefined reference to 'glClearColor'
view.cpp:29: error: undefined reference to 'glClear'
collect2: error: ld returned 1 exit status
make: *** [HW] Error 1