cmake_tutorial
cmake_tutorial copied to clipboard
does not compile
The reason is wrong directory name in some_libraries/include. Either CMakeList.txt or cpp file must be updated
$ cd some_libraries
$ mkdir build
$ cd build/
$ cmake ..
-- The CXX compiler identification is GNU 8.3.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ss/src/cmake-example/cmake_tutorial/some_libraries/build
$ make
Scanning dependencies of target SomeLibraryB
[ 25%] Building CXX object CMakeFiles/SomeLibraryB.dir/src/some_library_b.cpp.o
/home/ss/src/cmake-example/cmake_tutorial/some_libraries/src/some_library_b.cpp:2:10: fatal error: SomeLibraries/some_library_b.hpp: No such file or directory
#include "SomeLibraries/some_library_b.hpp"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/SomeLibraryB.dir/build.make:63: CMakeFiles/SomeLibraryB.dir/src/some_library_b.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/SomeLibraryB.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
Hi @sena73 , Thanks for the feedback! I just fixed the issue :-) Please try it with the commit below. https://github.com/rjhcnf/cmake_tutorial/commit/694f0ae4e428f81352852bf5a7bdbdd22595879d