openglsuperbible / sb7code

Source code and supporting material for the 7th Edition of OpenGL SuperBible
727 stars 251 forks source link

Fix linking error on ubuntu #13

Open dcanelhas opened 8 years ago

dcanelhas commented 8 years ago

using the cmake variable for glfw fixes the following linking error:

Linking CXX executable ../bin/alienrain /usr/bin/ld: cannot find -lglfw3 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

mxncr commented 8 years ago

Also fix the issue on Arch, thanks

bclinthall commented 6 years ago

This worked for me on Ubuntu. I couldn't compile without it.

RemusRomulus commented 5 years ago

Will try this for CentOS7

bdaase commented 5 years ago

Why is this not merged?

OdairTrujillo commented 3 years ago

Aditional to edit the line 28 with the GLFW_LIBRARIES variable inside the CMakeLists.txt file:

set(COMMON_LIBS sb7 ${GLFW_LIBRARIES} X11 Xrandr Xinerama Xi Xxf86vm Xcursor GL rt dl)

Also I had to install the following dependencies in Ubuntu 20.04:

libxi-dev
libxcursor-dev
libxinerama-dev
libxxf86vm-dev

And I had to run cmake like this: cmake .. -DOpenGL_GL_PREFERENCE=GLVND

In order to ensure the use of the NEW policy for CMP0072 policy.