麻烦尝试构建opengl superbible示例代码 [英] trouble trying to build opengl superbible example code

查看:386
本文介绍了麻烦尝试构建opengl superbible示例代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我得到了超级第六版,我试图cmake和做示例代码框架,但得到这个错误:

So I got the superbible 6th edition, and am trying to cmake and make the example code framework, but get this error:

Scanning dependencies of target sb6
[  1%] Building CXX object CMakeFiles/sb6.dir/src/sb6/sb6.cpp.o
[  2%] Building CXX object CMakeFiles/sb6.dir/src/sb6/sb6ktx.cpp.o
[  3%] Building CXX object CMakeFiles/sb6.dir/src/sb6/sb6object.cpp.o
[  5%] Building CXX object CMakeFiles/sb6.dir/src/sb6/sb6shader.cpp.o
[  6%] Building C object CMakeFiles/sb6.dir/src/sb6/gl3w.c.o
Linking CXX static library lib/libsb6.a
[  6%] Built target sb6
Scanning dependencies of target alienrain
[  7%] Building CXX object CMakeFiles/alienrain.dir/src/alienrain/alienrain.cpp.o
Linking CXX executable bin/alienrain
CMakeFiles/alienrain.dir/src/alienrain/alienrain.cpp.o: In function `sb6::application::run(sb6::application*)':
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x21): undefined reference to `glfwInit'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x7a): undefined reference to `glfwOpenWindowHint'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x90): undefined reference to `glfwOpenWindowHint'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x9f): undefined reference to `glfwOpenWindowHint'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0xae): undefined reference to `glfwOpenWindowHint'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0xc4): undefined reference to `glfwOpenWindowHint'
CMakeFiles/alienrain.dir/src/alienrain/alienrain.cpp.o:alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0xee): more undefined references to `glfwOpenWindowHint' follow
CMakeFiles/alienrain.dir/src/alienrain/alienrain.cpp.o: In function `sb6::application::run(sb6::application*)':
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x12c): undefined reference to `glfwGetDesktopMode'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x18e): undefined reference to `glfwOpenWindow'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x1a8): undefined reference to `glfwSwapInterval'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x1f2): undefined reference to `glfwOpenWindow'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x22e): undefined reference to `glfwSetWindowTitle'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x238): undefined reference to `glfwSetWindowSizeCallback'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x242): undefined reference to `glfwSetKeyCallback'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x24c): undefined reference to `glfwSetMouseButtonCallback'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x256): undefined reference to `glfwSetMousePosCallback'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x260): undefined reference to `glfwSetMouseWheelCallback'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x277): undefined reference to `glfwEnable'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x27e): undefined reference to `glfwDisable'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x28f): undefined reference to `glfwGetWindowParam'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x373): undefined reference to `glfwGetTime'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x393): undefined reference to `glfwSwapBuffers'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x39d): undefined reference to `glfwGetKey'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x3bd): undefined reference to `glfwGetWindowParam'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x3f5): undefined reference to `glfwTerminate'
lib/libsb6.a(gl3w.c.o): In function `open_libgl':
gl3w.c:(.text+0xf): undefined reference to `dlopen'
lib/libsb6.a(gl3w.c.o): In function `close_libgl':
gl3w.c:(.text+0x2b): undefined reference to `dlclose'
lib/libsb6.a(gl3w.c.o): In function `get_proc':
gl3w.c:(.text+0x45): undefined reference to `glXGetProcAddress'
gl3w.c:(.text+0x66): undefined reference to `dlsym'
collect2: error: ld returned 1 exit status
make[2]: *** [bin/alienrain] Error 1
make[1]: *** [CMakeFiles/alienrain.dir/all] Error 2
make: *** [all] Error 2

推荐答案

在第13行的CMakeLists.txt中有一个错误
https://github.com/openglsuperbible/sb6code/blob/master/CMakeLists。 txt

There is a bug in CMakeLists.txt at line 13. (https://github.com/openglsuperbible/sb6code/blob/master/CMakeLists.txt)

将elif(UNIX)更改为elseif(UNIX),即可。

Change "elif (UNIX)" to "elseif (UNIX)",and it will be ok.

参考:
https://www.opengl.org/discussion_boards/showthread.php/183902-SuperBible-6th-ed-Cannot-link-the-Linux-examples

这篇关于麻烦尝试构建opengl superbible示例代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆