[Ctk-developers] Link error with CTK and VTK

Quentan Qi quentan at gmail.com
Mon Mar 16 16:22:21 EDT 2015


Dear community members,

I am new with CTK, and want to use the CTK-VTK widget with Qt. The example <https://github.com/commontk/Examples> from the website works, but once VTK is added, a link error occurs, even though the cpp file has no change. I am quite confused about it, and want to find a solution.

* `CMakeLists.txt`

```
cmake_minimum_required(VERSION 2.8)
project(TEST_CTK)

find_package(VTK REQUIRED)
include(${VTK_USE_FILE})

find_package(CTK REQUIRED)
include(${CTK_USE_FILE})

find_package(QT4 REQUIRED)
include(${QT_USE_FILE})

set(SOURCE_FILES main.cpp)
add_executable(TEST_CTK ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} ${CTK_LIBRARIES})
```

* Error information

```
Scanning dependencies of target TEST_CTK
Linking CXX executable TEST_CTK
ld: library not found for -lvtkCommon
clang: error: linker command failed with exit code 1 (use -v to see invocation)
CMakeFiles/TEST_CTK.dir/build.make:90: recipe for target 'TEST_CTK' failed
gmake[3]: *** [TEST_CTK] Error 1
CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/TEST_CTK.dir/all' failed
gmake[2]: *** [CMakeFiles/TEST_CTK.dir/all] Error 2
CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/TEST_CTK.dir/rule' failed
gmake[1]: *** [CMakeFiles/TEST_CTK.dir/rule] Error 2
Makefile:110: recipe for target 'TEST_CTK' failed
gmake: *** [TEST_CTK] Error 2
```

* Environment: OS X 10.10 

Thank you very much!

Regards,
Quentan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/ctk-developers/attachments/20150316/7afeef95/attachment.html>


More information about the Ctk-developers mailing list