c++ - Issues with OpenGL referencing when compiling in Ubuntu terminal -
i working on compiling directory of c++ files , headers. thought installed opengl, glut , glew keep getting referencing errors when running it.
here doing , errors compiler sending me:
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 'glgeterror' check_gl.h:30: error: undefined reference 'glgeterror' check_gl.h:43: error: undefined reference 'glgeterror' poly_line.cpp:23: error: undefined reference 'glgenbuffers' poly_line.cpp:28: error: undefined reference 'glbindbuffer' poly_line.cpp:29: error: undefined reference 'glbufferdata' poly_line.cpp:54: error: undefined reference 'glenable' poly_line.cpp:55: error: undefined reference 'glenable' poly_line.cpp:56: error: undefined reference 'glblendfunc' poly_line.cpp:57: error: undefined reference 'glhint' poly_line.cpp:59: error: undefined reference 'gldisable' poly_line.cpp:60: error: undefined reference 'gldisable' poly_line.cpp:68: error: undefined reference 'glbindbuffer' poly_line.cpp:69: error: undefined reference 'glenablevertexattribarray' poly_line.cpp:70: error: undefined reference 'glvertexattribpointer' poly_line.cpp:78: error: undefined reference 'gldrawarrays' poly_line.cpp:80: error: undefined reference 'gldrawarrays' shader_program.cpp:104: error: undefined reference 'glcreateprogram' shader_program.cpp:113: error: undefined reference 'glgetprogramiv' shader_program.cpp:115: error: undefined reference 'glgetprogramiv' shader_program.cpp:120: error: undefined reference 'glgetprograminfolog' shader_program.cpp:135: error: undefined reference 'glgetshaderiv' shader_program.cpp:137: error: undefined reference 'glgetshaderiv' shader_program.cpp:142: error: undefined reference 'glgetshaderinfolog' shader_program.cpp:155: error: undefined reference 'gldeleteshader' shader_program.cpp:163: error: undefined reference 'gldeleteshader' shader_program.cpp:185: error: undefined reference 'glcreateshader' shader_program.cpp:195: error: undefined reference 'glshadersource' shader_program.cpp:200: error: undefined reference 'glcompileshader' shader_program.cpp:214: error: undefined reference 'glattachshader' shader_program.cpp:219: error: undefined reference 'gllinkprogram' shader_program.cpp:238: error: undefined reference 'gluseprogram' shader_program.cpp:249: error: undefined reference 'gluniform1f' shader_program.cpp:257: error: undefined reference 'gluniform1i' shader_program.cpp:270: error: undefined reference 'glgetuniformlocation' shader_program.cpp:290: error: undefined reference 'gluseprogram' shader_program.cpp:304: error: undefined reference 'glgetprogramiv' shader_program.cpp:308: error: undefined reference 'glgetprogramiv' shader_program.cpp:315: error: undefined reference 'glgetactiveuniform' view.cpp:28: error: undefined reference 'glclearcolor' view.cpp:29: error: undefined reference 'glclear' collect2: error: ld returned 1 exit status make: *** [hw] error 1
you have linked kitchen sink in example, forgot opengl library itself.
add gl
list of libraries in makefile. also, make sure link against last.
Comments
Post a Comment