<div dir="ltr"><div><div><div>Hi Quentan, <br><br></div>You are welcome !<br><br></div><div>I just fixed an issue preventing the Examples from being configured with the latest version of the CTK source. The fix has now been integrated. See [1]<br><br></div><div>Few comments regarding the CMakeLists.txt you pasted above:<br><br></div><div>  1: It should be "find_package(Qt4 REQUIRED)" instead of "find_package(QT4 REQUIRED)"<br><br></div><div>  2: Since CTKConfig.cmake already define "VTK_DIR" and "QT_QMAKE_EXECUTABLE",  you could simply the configuration of your project by including VTK and Qt after CTK.<br><br></div><div>That way configuring your project would be as simple as:<br><br></div><div>  cd TEST_CTK-build<br></div><div>  cmake -DCTK_DIR:PATH=/path/to/CTK-build ../CTK_TEST<br></div><div><br><br></div><div>All of that said, I wasn't able to reproduce your problem.<br><br></div><div>Few questions:<br><br></div><div>  a) Did you build VTK yourself or let the CTK superbuild taking care of it ?<br><br></div><div>  b) How did you configure CTK ? Which configure option ? On my side I used the option detailed in [2]. Since I add already a build of VTK available, I re-used it.<br></div><div><br><br></div><div>Hth<br></div><div>Jc<br></div><div><br>[1] <a href="https://github.com/commontk/CTK/commit/aee6addc33d5596026c0d47c8793270e91a95a2a">https://github.com/commontk/CTK/commit/aee6addc33d5596026c0d47c8793270e91a95a2a</a><br><br>[2] cmake -DQT_QMAKE_EXECUTABLE:FILEPATH=/home/jcfr/Support/qt-everywhere-opensource-release-build-4.8.6/bin/qmake -DVTK_DIR:PATH=/home/jcfr/Projects/Slicer-Debug/VTKv6-build/ -DCTK_ENABLE_Widgets:BOOL=1 -DCTK_LIB_Visualization/VTK/Widgets:BOOL=1 -DBUILD_TESTING:BOOL=0 ../CTK<br></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 16, 2015 at 4:22 PM, Quentan Qi <span dir="ltr"><<a href="mailto:quentan@gmail.com" target="_blank">quentan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Dear community members,<div><br></div><div>I am new with CTK, and want to use the CTK-VTK widget with Qt. <a href="https://github.com/commontk/Examples" target="_blank">The example</a> 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.</div><div><br></div><div>* `CMakeLists.txt`</div><div><br></div><div>```</div><div>cmake_minimum_required(VERSION 2.8)<br>project(TEST_CTK)<br><br>find_package(VTK REQUIRED)<br>include(${VTK_USE_FILE})<br><br>find_package(CTK REQUIRED)<br>include(${CTK_USE_FILE})<br><br>find_package(QT4 REQUIRED)<br>include(${QT_USE_FILE})<br><br>set(SOURCE_FILES main.cpp)<br>add_executable(TEST_CTK ${SOURCE_FILES})<br>target_link_libraries(${PROJECT_NAME} ${CTK_LIBRARIES})</div><div>```</div><div><br></div><div>* Error information</div><div><br></div><div>```</div><div><div>Scanning dependencies of target TEST_CTK</div><div>Linking CXX executable TEST_CTK</div><div>ld: library not found for -lvtkCommon</div><div>clang: error: linker command failed with exit code 1 (use -v to see invocation)</div><div>CMakeFiles/TEST_CTK.dir/build.make:90: recipe for target 'TEST_CTK' failed</div><div>gmake[3]: *** [TEST_CTK] Error 1</div><div>CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/TEST_CTK.dir/all' failed</div><div>gmake[2]: *** [CMakeFiles/TEST_CTK.dir/all] Error 2</div><div>CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/TEST_CTK.dir/rule' failed</div><div>gmake[1]: *** [CMakeFiles/TEST_CTK.dir/rule] Error 2</div><div>Makefile:110: recipe for target 'TEST_CTK' failed</div><div>gmake: *** [TEST_CTK] Error 2</div></div><div>```</div><div><br></div><div>* Environment: OS X 10.10 </div><div><br></div><div>Thank you very much!</div><div><br></div><div>Regards,</div><div>Quentan</div></div><br>_______________________________________________<br>
Ctk-developers mailing list<br>
<a href="mailto:Ctk-developers@public.kitware.com">Ctk-developers@public.kitware.com</a><br>
<a href="http://public.kitware.com/mailman/listinfo/ctk-developers" target="_blank">http://public.kitware.com/mailman/listinfo/ctk-developers</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">+1 919 869 8849<br></div>
</div>