On Windows in Visual Studio, it was enough to scatter files into special folders and register:
#include <GL/glut.h> #pragma comment (lib, "opengl32.lib") #pragma comment (lib, "glu32.lib") #pragma comment (lib, "glut32.lib")
How to be on Linux? From this answer I understood that #pragma comment
will not work. I also realized that in CMakeLists.txt
you need to prescribe all the links yourself. I put freeglut3-dev
and what do I link from?
Here is my CMakeLists.txt
:
cmake_minimum_required(VERSION 3.8) project(paintc) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") file(GLOB SOURCES "*.cpp" "*.h") add_executable(paintc ${SOURCES})
FIND_PACKAGE
to help you, apparently. Well, apparently libraries will be called differently (apparently: freeglut3-dev file list ) - vegorovfind_package(Exiv2) include_directories( ${EXIV2_INCLUDE_DIR}) target_link_libraries(${PROJECT_NAME} ${EXIV2_LIBRARIES})
- vegorov