我正在尝试在 Ubuntu 下构建 oglpg-8th-edition。我已经设置了链接器并包含了头文件夹,如下所示:
g++ -L/home/maki/Downloads/oglpg-8th-edition/lib -o "test5" ./LoadShaders.o ./source.o -lglew32 -lfreeglut
当我使用 eclipse 构建它时,我得到:
./LoadShaders.o:在函数LoadShaders':
/home/bkk/workspace/test5/Debug/../LoadShaders.cpp:59: undefined reference to
_glewCreateProgram '/home/bkk/workspace/test5/Debug/../LoadShaders.cpp:63:未定义引用__glewCreateShader'
/home/bkk/workspace/test5/Debug/../LoadShaders.cpp:70: undefined reference to
_glewDeleteShader'/home/bkk /workspace/test5/Debug/../ LoadShaders.cpp:77: 未定义引用__glewShaderSource'
/home/bkk/workspace/test5/Debug/../LoadShaders.cpp:80: undefined reference to
_glewCompileShader ' /home/bkk/workspace/test5/Debug/../LoadShaders.cpp:83: 未定义引用__glewGetShaderiv'
/home/bkk/workspace/test5/Debug/../LoadShaders.cpp:98: undefined reference to
_glewAttachShader' /home/bkk/workspace/test5/Debug/.. /LoadShaders.cpp:109: 未定义引用__glewLinkProgram'
/home/bkk/workspace/test5/Debug/../LoadShaders.cpp:112: undefined reference to
_glewGetProgramiv ' /home/bkk/workspace/test5/Debug/../LoadShaders.cpp:125: 未定义引用` _glewDeleteShader'
我也认为所有的软件包都安装好了。任何想法我可能哪里出错了?