【OpenGL学习 1】环境的配置

OpenGL Installation and Configuration

ubuntu & c++

Install

Fatal error: gl/glut.h: no such file or directory

sudo apt-get install freeglut3-dev
CMakeLists.txt
find_package(OpenGL REQUIRED)
find_package(GLUT REQUIRED)
include_directories(${OPENGL_INCLUDE_DIRS} ${GLUT_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} ${OPENGL_LIBRARIES} ${GLUT_LIBRARY})

windows7 & vs2017

required

glut and glew

ubuntu & Codeblocks

  1. Go Codeblocks with settings -> compiler -> Linker settings
  2. Create a Project in codeblocks
  3. add the following library

/usr/lib/x86_64-linux-gnu/libGL.so
/usr/lib/x86_64-linux-gnu/libGLU.so
/usr/lib/x86_64-linux-gnu/libglut.so

你可能感兴趣的:(编程技术)