Commit fd982175 causes /usr/bin/ld: cannot find -lvtkFiltersTopology bug
I am on Ubuntu 16.04, GCC 5.4.
Here are the steps to reproduce it
git clone https://github.com/Kitware/VTK
cd VTK && mkdir build && cd build
cmake ..
sudo make install
Now I want to use VTK in my project, here is the minimal CMakeLists.txt
to reproduce it
cmake_minimum_required(VERSION 3.7)
project(sample1)
set(PROJECT_SRCS ${PROJECT_SOURCE_DIR}/src/main.cpp)
find_package(VTK REQUIRED)
add_executable(${PROJECT_NAME} ${PROJECT_SRCS})
target_link_libraries(${PROJECT_NAME} ${VTK_LIBRARIES})
and main.cpp
can be as simple as
int main(){
return 0;
}
and here is the compilation error when the code is compiled
[100%] Linking CXX executable sample1
/usr/bin/ld: cannot find -lvtkFiltersTopology
collect2: error: ld returned 1 exit status
However, if I do a locate libvtkFiltersTopology
, it returns
/home/jasjuang/VTK/build/lib/libvtkFiltersTopology-7.1.so
/home/jasjuang/VTK/build/lib/libvtkFiltersTopology-7.1.so.1
/usr/local/lib/libvtkFiltersTopology-7.1.so
/usr/local/lib/libvtkFiltersTopology-7.1.so.1
What's wrong?