Ubuntu에서
OpenGL Super Bible 6th 예제들을 돌려보려 하다보면 HOWTOBUILD.txt 에 있는 내용대로 따라하더라도
alienrain.cpp 파일을 빌드하면서 부터 시작해서 undefined reference to ~~ 빌드 에러가 주욱 나올 것이다.
(에러로그는 하단에)
지난 주말간 삽질한 결과로 해결방법은 찾을 수 있었는데
원인은 sb6code-master/CMakeList.txt에 잘못 작성된 버그라 한다.
그래서 CMakeLists.txt 파일의 13번째 line에 있는 elif(UNIX)를 elseif(UNIX)로 고치면
정상적으로 빌드가 진행된다.
참고 링크
- http://stackoverflow.com/questions/23024789/trouble-trying-to-build-opengl-superbible-example-code // chcby
- https://www.opengl.org/discussion_boards/showthread.php/183902-SuperBible-6th-ed-Cannot-link-the-Linux-examples // Bobbyson
에러 로그 >
CMakeFiles/alienrain.dir/src/alienrain/alienrain.cpp.o: In function `sb6::application::run(sb6::application*)':
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x1c): undefined reference to `sb6::application::app'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x35): undefined reference to `glfwInit'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0xb6): undefined reference to `glfwOpenWindowHint'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0xe0): undefined reference to `glfwOpenWindowHint'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x117): undefined reference to `glfwOpenWindowHint'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x126): undefined reference to `glfwOpenWindowHint'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x13c): undefined reference to `glfwOpenWindowHint'
CMakeFiles/alienrain.dir/src/alienrain/alienrain.cpp.o:alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x166): 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_]+0x1cc): undefined reference to `glfwGetDesktopMode'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x22e): undefined reference to `glfwOpenWindow'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x248): undefined reference to `glfwSwapInterval'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x295): undefined reference to `glfwOpenWindow'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x2e5): undefined reference to `glfwSetWindowTitle'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x2ef): undefined reference to `glfwSetWindowSizeCallback'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x2f9): undefined reference to `glfwSetKeyCallback'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x303): undefined reference to `glfwSetMouseButtonCallback'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x30d): undefined reference to `glfwSetMousePosCallback'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x317): undefined reference to `glfwSetMouseWheelCallback'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x32e): undefined reference to `glfwEnable'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x335): undefined reference to `glfwDisable'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x346): undefined reference to `glfwGetWindowParam'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x37b): undefined reference to `gl3wInit'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x39c): undefined reference to `gl3wIsSupported'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x3ac): undefined reference to `gl3wDebugMessageCallback'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x3c1): undefined reference to `gl3wEnable'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x3d4): undefined reference to `sb6IsExtensionSupported(char const*)'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x3e4): undefined reference to `gl3wDebugMessageCallbackARB'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x3f9): undefined reference to `gl3wEnable'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x42a): undefined reference to `glfwGetTime'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x44a): undefined reference to `glfwSwapBuffers'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x454): undefined reference to `glfwGetKey'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x474): undefined reference to `glfwGetWindowParam'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x4ac): undefined reference to `glfwTerminate'
CMakeFiles/alienrain.dir/src/alienrain/alienrain.cpp.o: In function `sb6::application::glfw_onResize(int, int)':
alienrain.cpp:(.text._ZN3sb611application13glfw_onResizeEii[_ZN3sb611application13glfw_onResizeEii]+0x11): undefined reference to `sb6::application::app'
alienrain.cpp:(.text._ZN3sb611application13glfw_onResizeEii[_ZN3sb611application13glfw_onResizeEii]+0x22): undefined reference to `sb6::application::app'
CMakeFiles/alienrain.dir/src/alienrain/alienrain.cpp.o: In function `sb6::application::glfw_onKey(int, int)':
alienrain.cpp:(.text._ZN3sb611application10glfw_onKeyEii[_ZN3sb611application10glfw_onKeyEii]+0x11): undefined reference to `sb6::application::app'
alienrain.cpp:(.text._ZN3sb611application10glfw_onKeyEii[_ZN3sb611application10glfw_onKeyEii]+0x22): undefined reference to `sb6::application::app'
CMakeFiles/alienrain.dir/src/alienrain/alienrain.cpp.o: In function `sb6::application::glfw_onMouseButton(int, int)':
alienrain.cpp:(.text._ZN3sb611application18glfw_onMouseButtonEii[_ZN3sb611application18glfw_onMouseButtonEii]+0x11): undefined reference to `sb6::application::app'
CMakeFiles/alienrain.dir/src/alienrain/alienrain.cpp.o:alienrain.cpp:(.text._ZN3sb611application18glfw_onMouseButtonEii[_ZN3sb611application18glfw_onMouseButtonEii]+0x22): more undefined references to `sb6::application::app' follow
CMakeFiles/alienrain.dir/src/alienrain/alienrain.cpp.o: In function `alienrain_app::startup()':
alienrain.cpp:(.text._ZN13alienrain_app7startupEv[_ZN13alienrain_app7startupEv]+0x24): undefined reference to `gl3wCreateShader'
alienrain.cpp:(.text._ZN13alienrain_app7startupEv[_ZN13alienrain_app7startupEv]+0x38): undefined reference to `gl3wShaderSource'
alienrain.cpp:(.text._ZN13alienrain_app7startupEv[_ZN13alienrain_app7startupEv]+0x56): undefined reference to `gl3wCompileShader'
alienrain.cpp:(.text._ZN13alienrain_app7startupEv[_ZN13alienrain_app7startupEv]+0x67): undefined reference to `gl3wGetShaderInfoLog'
alienrain.cpp:(.text._ZN13alienrain_app7startupEv[_ZN13alienrain_app7startupEv]+0x8a): undefined reference to `gl3wCreateShader'
alienrain.cpp:(.text._ZN13alienrain_app7startupEv[_ZN13alienrain_app7startupEv]+0x9e): undefined reference to `gl3wShaderSource'
alienrain.cpp:(.text._ZN13alienrain_app7startupEv[_ZN13alienrain_app7startupEv]+0xbc): undefined reference to `gl3wCompileShader'
alienrain.cpp:(.text._ZN13alienrain_app7startupEv[_ZN13alienrain_app7startupEv]+0xcd): undefined reference to `gl3wGetShaderInfoLog'
alienrain.cpp:(.text._ZN13alienrain_app7startupEv[_ZN13alienrain_app7startupEv]+0xf0): undefined reference to `gl3wCreateProgram'
alienrain.cpp:(.text._ZN13alienrain_app7startupEv[_ZN13alienrain_app7startupEv]+0x106): undefined reference to `gl3wAttachShader'
alienrain.cpp:(.text._ZN13alienrain_app7startupEv[_ZN13alienrain_app7startupEv]+0x126): undefined reference to `gl3wAttachShader'
alienrain.cpp:(.text._ZN13alienrain_app7startupEv[_ZN13alienrain_app7startupEv]+0x146): undefined reference to `gl3wLinkProgram'
alienrain.cpp:(.text._ZN13alienrain_app7startupEv[_ZN13alienrain_app7startupEv]+0x15e): undefined reference to `gl3wDeleteShader'
alienrain.cpp:(.text._ZN13alienrain_app7startupEv[_ZN13alienrain_app7startupEv]+0x16f): undefined reference to `gl3wDeleteShader'
alienrain.cpp:(.text._ZN13alienrain_app7startupEv[_ZN13alienrain_app7startupEv]+0x180): undefined reference to `gl3wGenVertexArrays'
alienrain.cpp:(.text._ZN13alienrain_app7startupEv[_ZN13alienrain_app7startupEv]+0x19f): undefined reference to `gl3wBindVertexArray'
alienrain.cpp:(.text._ZN13alienrain_app7startupEv[_ZN13alienrain_app7startupEv]+0x1bf): undefined reference to `sb6::ktx::file::load(char const*, unsigned int)'
alienrain.cpp:(.text._ZN13alienrain_app7startupEv[_ZN13alienrain_app7startupEv]+0x1d3): undefined reference to `gl3wBindTexture'
alienrain.cpp:(.text._ZN13alienrain_app7startupEv[_ZN13alienrain_app7startupEv]+0x1f0): undefined reference to `gl3wTexParameteri'
alienrain.cpp:(.text._ZN13alienrain_app7startupEv[_ZN13alienrain_app7startupEv]+0x208): undefined reference to `gl3wGenBuffers'
alienrain.cpp:(.text._ZN13alienrain_app7startupEv[_ZN13alienrain_app7startupEv]+0x227): undefined reference to `gl3wBindBuffer'
alienrain.cpp:(.text._ZN13alienrain_app7startupEv[_ZN13alienrain_app7startupEv]+0x244): undefined reference to `gl3wBufferData'
alienrain.cpp:(.text._ZN13alienrain_app7startupEv[_ZN13alienrain_app7startupEv]+0x33f): undefined reference to `gl3wBindVertexArray'
alienrain.cpp:(.text._ZN13alienrain_app7startupEv[_ZN13alienrain_app7startupEv]+0x357): undefined reference to `gl3wEnable'
alienrain.cpp:(.text._ZN13alienrain_app7startupEv[_ZN13alienrain_app7startupEv]+0x365): undefined reference to `gl3wBlendFunc'
CMakeFiles/alienrain.dir/src/alienrain/alienrain.cpp.o: In function `alienrain_app::render(double)':
alienrain.cpp:(.text._ZN13alienrain_app6renderEd[_ZN13alienrain_app6renderEd]+0x23): undefined reference to `gl3wViewport'
alienrain.cpp:(.text._ZN13alienrain_app6renderEd[_ZN13alienrain_app6renderEd]+0x4a): undefined reference to `gl3wClearBufferfv'
alienrain.cpp:(.text._ZN13alienrain_app6renderEd[_ZN13alienrain_app6renderEd]+0x62): undefined reference to `gl3wUseProgram'
alienrain.cpp:(.text._ZN13alienrain_app6renderEd[_ZN13alienrain_app6renderEd]+0x77): undefined reference to `gl3wBindBufferBase'
alienrain.cpp:(.text._ZN13alienrain_app6renderEd[_ZN13alienrain_app6renderEd]+0x94): undefined reference to `gl3wMapBufferRange'
alienrain.cpp:(.text._ZN13alienrain_app6renderEd[_ZN13alienrain_app6renderEd]+0x1d9): undefined reference to `gl3wUnmapBuffer'
alienrain.cpp:(.text._ZN13alienrain_app6renderEd[_ZN13alienrain_app6renderEd]+0x1f0): undefined reference to `gl3wVertexAttribI1i'
alienrain.cpp:(.text._ZN13alienrain_app6renderEd[_ZN13alienrain_app6renderEd]+0x203): undefined reference to `gl3wDrawArrays'
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
'Programming > OpenGL' 카테고리의 다른 글
macOS(OS X)에서 OpenGL Super Bible 7th 예제 빌드하기. (sb7code-master 버전, macOS(OS X) Sierra 10.12) (1) | 2017.06.06 |
---|---|
OpenGL Super Bible 7th 예제 빌드하기. (sb7code-master 버전, Windows 환경) (5) | 2016.12.04 |
[Ubuntu] 우분투에서 GLFW 빌드시 "libglfw.so: cannot open" error 발생. (0) | 2016.04.12 |
OpenGL Super Bible 6th 예제 실행하기. (8) | 2016.04.11 |