Question

I am trying to build the oglpg-8th-edition under Ubuntu. I have set the linker and included the header folder as follows:

g++ -L/home/maki/Downloads/oglpg-8th-edition/lib -o "test5" ./LoadShaders.o ./source.o -lglew32 -lfreeglut

When I build it using eclipse I get:

./LoadShaders.o: In function LoadShaders': /home/bkk/workspace/test5/Debug/../LoadShaders.cpp:59: undefined reference to_glewCreateProgram' /home/bkk/workspace/test5/Debug/../LoadShaders.cpp:63: undefined reference to __glewCreateShader' /home/bkk/workspace/test5/Debug/../LoadShaders.cpp:70: undefined reference to_glewDeleteShader' /home/bkk/workspace/test5/Debug/../LoadShaders.cpp:77: undefined reference to __glewShaderSource' /home/bkk/workspace/test5/Debug/../LoadShaders.cpp:80: undefined reference to_glewCompileShader' /home/bkk/workspace/test5/Debug/../LoadShaders.cpp:83: undefined reference to __glewGetShaderiv' /home/bkk/workspace/test5/Debug/../LoadShaders.cpp:98: undefined reference to_glewAttachShader' /home/bkk/workspace/test5/Debug/../LoadShaders.cpp:109: undefined reference to __glewLinkProgram' /home/bkk/workspace/test5/Debug/../LoadShaders.cpp:112: undefined reference to_glewGetProgramiv' /home/bkk/workspace/test5/Debug/../LoadShaders.cpp:125: undefined reference to `_glewDeleteShader'

I also think all the packages installed. Any ideas where might I have gone wrong?

Was it helpful?

Solution

In Linux, the library you link against is called libGLEW. Your distribution may have this library in binary form for Linux, though it is not officially distributed this way. When you build the library for Linux, it should output: libGLEW.so.

Thus your Makefile should be using -lGLEW instead of -lglew32 (this is for MinGW / Cygwin).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top