Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make error in cmake using a shared/static library tutorial #21

Open
opheliagame opened this issue Oct 30, 2018 · 0 comments
Open

make error in cmake using a shared/static library tutorial #21

opheliagame opened this issue Oct 30, 2018 · 0 comments

Comments

@opheliagame
Copy link

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} )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant