Using VTK 6.2, there are multiple link errors when trying to make a project:
/usr/bin/ld: cannot find -lvtkWrappingTools /usr/bin/ld: cannot find -lvtkGUISupportQt /usr/bin/ld: cannot find -lvtkWrappingPythonCore /usr/bin/ld: cannot find -lvtkFiltersPython /usr/bin/ld: cannot find -lvtkGUISupportQtSQL /usr/bin/ld: cannot find -lvtkRenderingQt /usr/bin/ld: cannot find -lvtkglew /usr/bin/ld: cannot find -lvtkGUISupportQtOpenGL /usr/bin/ld: cannot find -lvtkLocalExample /usr/bin/ld: cannot find -lvtkViewsQt /usr/bin/ld: cannot find -lvtkoggtheora /usr/bin/ld: cannot find -lvtkGUISupportQtWebkit Problem:
Unresolved linker errors. This may be a path issue, since the libraries appear to be present in /usr/local/ but are not seen by ld at compile time...
Background information:
- OS is Ubuntu 13.10
- VTK is 6.2 from the Kitware github
- CMake file follows guidelines supplied by the Kitware CMake for VTK 6+ docs
VTK was configured as an out-of-source CMake build (no problems) followed by make and make install so that all of the libraries are correctly placed in /usr/local/lib.
My project build now uses the following CMakeLists.txt:
# Add VTK, insist that it uses 6.2, find_package(VTK 6.2 EXACT REQUIRED NO_MODULE) include(${VTK_USE_FILE}) find_package(GLEW REQUIRED) set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS ${VTK_DEFINITIONS}) include_directories( ${VTK_INCLUDE_DIRS} ${GLEW_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ) #################### # Make my_target #################### set(EXE my_target) set(SOURCES my_target.cpp ) add_executable(${EXE} ${SOURCES}) target_link_libraries(${EXE} ${VTK_LIBRARIES} ${GLEW_LIBRARY} ) ###################