here`s my CMakeLists.txt
cmake_minimum_required (VERSION 2.8)
project(GL_test_01)
find_package(OpenGL REQUIRED)
find_package(OpenCV REQUIRED)
include_directories(${OpenGL_INCLUDE_DIRS})
include_directories(${OpenCV_INCLUDE_DIRS})
add_executable(GL01_exe v01.cpp)
target_link_libraries(GL01_exe ${OpenCV_LIBS})
target_link_libraries(GL01_exe ${OpenGL_LIBS})
but it makes error :
nvidia@tegra-ubuntu:~/SSU_OpenCV/GL test 01/build$ make
Scanning dependencies of target GL01_exe
[ 50%] Building CXX object CMakeFiles/GL01_exe.dir/v01.cpp.o
[100%] Linking CXX executable GL01_exe
CMakeFiles/GL01_exe.dir/v01.cpp.o: In function main': //(every lines with gl~ or glut~ or glu~) CMakeFiles/GL01_exe.dir/v01.cpp.o:v01.cpp:(.text+0x480): more undefined references to
glVertex3f’ follow
CMakeFiles/GL01_exe.dir/v01.cpp.o: In function MyWall()': v01.cpp:(.text+0x5c4): undefined reference to
glEnd’
collect2: error: ld returned 1 exit status
CMakeFiles/GL01_exe.dir/build.make:124: recipe for target ‘GL01_exe’ failed
make[2]: *** [GL01_exe] Error 1
CMakeFiles/Makefile2:67: recipe for target ‘CMakeFiles/GL01_exe.dir/all’ failed
make[1]: *** [CMakeFiles/GL01_exe.dir/all] Error 2
Makefile:83: recipe for target ‘all’ failed
make: *** [all] Error 2
I think I didn`t make CMakeLists.txt well.
Could you find wrong things in my code?