I'm using CMake with CLion and I'm having some problems when trying to compile ILUT, GLUT and some other libraries.
Error log is here:
"C:\Program Files\JetBrains\CLion 2017.2.2\bin\cmake\bin\cmake.exe" --build C:\Users\LifEorDeatH\CLionProjects\SeaShepherd\cmake-build-debug --target untitled -- -j 4
Scanning dependencies of target untitled
[ 50%] Building CXX object CMakeFiles/untitled.dir/main.cpp.obj
In file included from C:\Users\LifEorDeatH\CLionProjects\SeaShepherd\main.cpp:1:0:
C:\Users\LifEorDeatH\CLionProjects\SeaShepherd\P5c.h:371:20: warning: literal operator suffixes not preceded by '_' are reserved for future standardization
PString operator"" s(const char* text, std::size_t len) {
^
C:\Users\LifEorDeatH\CLionProjects\SeaShepherd\P5c.h:816:85: warning: converting to non-pointer type 'float' from NULL [-Wconversion-null]
double dist(float a1, float a2, float a3, float a4, float a5 = NULL, float a6 = NULL) {
^
C:\Users\LifEorDeatH\CLionProjects\SeaShepherd\P5c.h:816:85: warning: converting to non-pointer type 'float' from NULL [-Wconversion-null]
C:\Users\LifEorDeatH\CLionProjects\SeaShepherd\P5c.h: In function 'double dist(float, float, float, float, float, float)':
C:\Users\LifEorDeatH\CLionProjects\SeaShepherd\P5c.h:817:15: warning: NULL used in arithmetic [-Wpointer-arith]
if (a5 == NULL || a6 == NULL) {
^~~~
C:\Users\LifEorDeatH\CLionProjects\SeaShepherd\P5c.h:817:29: warning: NULL used in arithmetic [-Wpointer-arith]
if (a5 == NULL || a6 == NULL) {
^~~~
[100%] Linking CXX executable untitled.exe
CMakeFiles\untitled.dir/objects.a(main.cpp.obj): In function `glutInit_ATEXIT_HACK':
c:/mingw/include/gl/freeglut_std.h:623: undefined reference to `_imp____glutInitWithExit@12'
CMakeFiles\untitled.dir/objects.a(main.cpp.obj): In function `glutCreateWindow_ATEXIT_HACK':
c:/mingw/include/gl/freeglut_std.h:625: undefined reference to `_imp____glutCreateWindowWithExit@8'
CMakeFiles\untitled.dir/objects.a(main.cpp.obj): In function `glutCreateMenu_ATEXIT_HACK':
c:/mingw/include/gl/freeglut_std.h:627: undefined reference to `_imp____glutCreateMenuWithExit@8'
CMakeFiles\untitled.dir/objects.a(main.cpp.obj): In function `main':
C:/Users/LifEorDeatH/CLionProjects/SeaShepherd/P5c.h:408: undefined reference to `_imp__ilInit@0'
C:/Users/LifEorDeatH/CLionProjects/SeaShepherd/P5c.h:409: undefined reference to `_imp__iluInit@0'
C:/Users/LifEorDeatH/CLionProjects/SeaShepherd/P5c.h:410: undefined reference to `_imp__ilutInit@0'
C:/Users/LifEorDeatH/CLionProjects/SeaShepherd/P5c.h:411: undefined reference to `_imp__ilutRenderer@4'
C:/Users/LifEorDeatH/CLionProjects/SeaShepherd/P5c.h:419: undefined reference to `_imp__glutMainLoop@0'
CMakeFiles\untitled.dir/objects.a(main.cpp.obj): In function `Z4sizeiii':
C:/Users/LifEorDeatH/CLionProjects/SeaShepherd/P5c.h:435: undefined reference to `_imp__glutInitDisplayMode@4'
C:/Users/LifEorDeatH/CLionProjects/SeaShepherd/P5c.h:436: undefined reference to `_imp__glutInitWindowSize@8'
C:/Users/LifEorDeatH/CLionProjects/SeaShepherd/P5c.h:445: undefined reference to `_imp__glutReshapeFunc@4'
C:/Users/LifEorDeatH/CLionProjects/SeaShepherd/P5c.h:446: undefined reference to `_imp__glutKeyboardFunc@4'
C:/Users/LifEorDeatH/CLionProjects/SeaShepherd/P5c.h:447: undefined reference to `_imp__glutKeyboardUpFunc@4'
C:/Users/LifEorDeatH/CLionProjects/SeaShepherd/P5c.h:448: undefined reference to `_imp__glutMotionFunc@4'
C:/Users/LifEorDeatH/CLionProjects/SeaShepherd/P5c.h:449: undefined reference to `_imp__glutPassiveMotionFunc@4'
C:/Users/LifEorDeatH/CLionProjects/SeaShepherd/P5c.h:450: undefined reference to `_imp__glutMouseFunc@4'
C:/Users/LifEorDeatH/CLionProjects/SeaShepherd/P5c.h:451: undefined reference to `_imp__glutDisplayFunc@4'
CMakeFiles\untitled.dir/objects.a(main.cpp.obj): In function `Z7displayv':
C:/Users/LifEorDeatH/CLionProjects/SeaShepherd/P5c.h:529: undefined reference to `_imp__glutPostRedisplay@0'
CMakeFiles\untitled.dir/objects.a(main.cpp.obj): In function `Z9loadImagePKc':
C:/Users/LifEorDeatH/CLionProjects/SeaShepherd/P5c.h:724: undefined reference to `_imp__ilLoadImage@4'
C:/Users/LifEorDeatH/CLionProjects/SeaShepherd/P5c.h:728: undefined reference to `_imp__ilGetError@0'
C:/Users/LifEorDeatH/CLionProjects/SeaShepherd/P5c.h:728: undefined reference to `_imp__iluErrorString@4'
C:/Users/LifEorDeatH/CLionProjects/SeaShepherd/P5c.h:732: undefined reference to `_imp__ilGetInteger@4'
C:/Users/LifEorDeatH/CLionProjects/SeaShepherd/P5c.h:733: undefined reference to `_imp__ilGetInteger@4'
C:/Users/LifEorDeatH/CLionProjects/SeaShepherd/P5c.h:739: undefined reference to `_imp__ilConvertImage@8'
C:/Users/LifEorDeatH/CLionProjects/SeaShepherd/P5c.h:740: undefined reference to `_imp__iluFlipImage@0'
C:/Users/LifEorDeatH/CLionProjects/SeaShepherd/P5c.h:741: undefined reference to `_imp__ilGetData@0'
CMakeFiles\untitled.dir/objects.a(main.cpp.obj): In function `Z4textPcii':
C:/Users/LifEorDeatH/CLionProjects/SeaShepherd/P5c.h:752: undefined reference to `_imp__glutBitmapCharacter@8'
CMakeFiles\untitled.dir/objects.a(main.cpp.obj): In function `Z4text7PStringii':
C:/Users/LifEorDeatH/CLionProjects/SeaShepherd/P5c.h:765: undefined reference to `_imp__glutBitmapCharacter@8'
CMakeFiles\untitled.dir/objects.a(main.cpp.obj): In function `Z6millisv':
C:/Users/LifEorDeatH/CLionProjects/SeaShepherd/P5c.h:772: undefined reference to `_imp__glutGet@4'
collect2.exe: error: ld returned 1 exit status
CMakeFiles\untitled.dir\build.make:97: recipe for target 'untitled.exe' failed
CMakeFiles\Makefile2:66: recipe for target 'CMakeFiles/untitled.dir/all' failed
mingw32-make.exe[3]: *** [untitled.exe] Error 1
mingw32-make.exe[2]: *** [CMakeFiles/untitled.dir/all] Error 2
mingw32-make.exe[1]: *** [CMakeFiles/untitled.dir/rule] Error 2
CMakeFiles\Makefile2:78: recipe for target 'CMakeFiles/untitled.dir/rule' failed
Makefile:117: recipe for target 'untitled' failed
mingw32-make.exe: *** [untitled] Error 2
CMakeLists.txt
cmake_minimum_required(VERSION 3.8)
project(untitled)
set(CMAKE_CXX_STANDARD 11)
set(SOURCE_FILES main.cpp P5c.h Button.h Level1.h LevelSelector.h MainMenu.h ${CMAKE_CURRENT_SOURCE_DIR}/libs/)
add_executable(untitled ${SOURCE_FILES})
find_package(OpenGL REQUIRED)
find_package(GLUT REQUIRED)
#find_package(IL REQUIRED)
#FIND_PATH(IL_INCLUDE_DIRS il.h PATH_SUFFIXES include IL DOC "The path the the directory that contains il.h")
#FIND_LIBRARY(IL_LIBRARIES NAMES IL DEVIL PATH_SUFFIXES lib64 lib lib32 DOC "The file that corresponds to the base il library.")
#FIND_LIBRARY(ILUT_LIBRARIES NAMES ILUT PATH_SUFFIXES lib64 lib lib32 DOC "The file that corresponds to the il (system?) utility library.")
#FIND_LIBRARY(ILU_LIBRARIES NAMES ILU PATH_SUFFIXES lib64 lib lib32 DOC "The file that corresponds to the il utility library.")
#target_link_libraries(IL_LIBRARIES ${CMAKE_CURRENT_SOURCE_DIR} /libs/)
include_directories(${OPENGL_INCLUDE_DIRS} ${GLUT_INCLUDE_DIRS} ${LIBPNG_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/libs)
#${IL_INCLUDE_DIRS}
target_link_libraries(untitled ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} ${LIBPNG_LIBRARIES} ${CMAKE_CURRENT_SOURCE_DIR}/libs )
#${IL_LIBRARIES} ${ILU_LIBRARIES} ${ILUT_LIBRARIES}
My libs folder looks like this:
I think that there is an error, where CMake can't find the ILUT library I have stored inside of the /libs/ folder. How can I fix this and what am I doing wrong here?