You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I went through the cmake tutorial and the last example of using the shared or static library is giving me an error in the make step of the process. $ make [ 50%] Building CXX object CMakeFiles/libtest.dir/libtest.cpp.o /exploringBB/extras/cmake/usestudentlib/libtest.cpp:1:21: fatal error: Student.h: No such file or directory compilation terminated. CMakeFiles/libtest.dir/build.make:62: recipe for target 'CMakeFiles/libtest.dir/libtest.cpp.o' failed make[2]: *** [CMakeFiles/libtest.dir/libtest.cpp.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/libtest.dir/all' failed make[1]: *** [CMakeFiles/libtest.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2
Can someone explain why this is happening?
This is my CMakeLists.txt
I went through the cmake tutorial and the last example of using the shared or static library is giving me an error in the make step of the process.
$ make
[ 50%] Building CXX object CMakeFiles/libtest.dir/libtest.cpp.o /exploringBB/extras/cmake/usestudentlib/libtest.cpp:1:21: fatal error: Student.h: No such file or directory compilation terminated. CMakeFiles/libtest.dir/build.make:62: recipe for target 'CMakeFiles/libtest.dir/libtest.cpp.o' failed make[2]: *** [CMakeFiles/libtest.dir/libtest.cpp.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/libtest.dir/all' failed make[1]: *** [CMakeFiles/libtest.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2
Can someone explain why this is happening?
This is my CMakeLists.txt
cmake_minimum_required(VERSION 2.8.9)
project (TestLibrary)
#For the shared library:
set ( PROJECT_LINK_LIBS libtestStudent.so )
link_directories( ~/exploringBB/extras/cmake/studentlib_shared/build )
#For the static library:
#set ( PROJECT_LINK_LIBS libtestStudent.a )
#link_directories( ~/exploringBB/extras/cmake/studentlib_static/build )
include_directories("~/exploringBB/extras/cmake/studentlib_shared/include")
add_executable(libtest libtest.cpp)
target_link_libraries(libtest ${PROJECT_LINK_LIBS} )
The text was updated successfully, but these errors were encountered: