<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Jean,<div class=""><br class=""></div><div class="">Thanks a lot for your detailed explanation!</div><div class=""><br class=""></div><div class="">I recompiled CTK using the latest VTK 6.2.0 and it works well. No glitch complains from that example any more. </div><div class=""><br class=""></div><div class="">But the Qt widgets `ctkVTKRenderView` and `ctkVTKSliceView`, which come from library file `Qt\plugin\designer\libCTKVisualizationVTKWidgetsPlugins.so`,  fail to work and crash Qt Designer. All the other widgets work correctly. This may not be a serious problem.</div><div class=""><br class=""></div><div class="">I’m now running on OS X 10.10 with VTK 6.2.0 and Qt 4.8.6. I also wonder when CTK can work with Qt 5, because VTK is quite compatible with it but I failed to compile CTK with VTK 6.2.0 bundled with Qt 5.2.1.</div><div class=""><br class=""></div><div class="">My current cmake option is:</div><div class=""><br class=""></div><div class="">```</div><div class="">cmake -DCMAKE_BUILD_TYPE:STRING=Release -DCTK_ENABLE_Widgets:BOOL=ON -DCTK_LIB_Visualization/VTK/Widgets:BOOL=ON -DVTK_DIR:PATH=/usr/local/vtk/lib/cmake/vtk-6.2 ../CTKSource</div><div class="">```</div><div class=""><br class=""></div><div class="">Qt’s path can be found by cmake automatically.</div><div class=""><br class=""></div><div class="">Cheers,</div><div class="">Quentan</div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 26 Mar 2015, at 04:30, Jean-Christophe Fillion-Robin <<a href="mailto:jchris.fillionr@kitware.com" class="">jchris.fillionr@kitware.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class=""><div class=""><div class="">Hi Quentan, <br class=""><br class=""></div>You are welcome !<br class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">Few comments regarding the CMakeLists.txt you pasted above:<br class=""><br class=""></div><div class="">  1: It should be "find_package(Qt4 REQUIRED)" instead of "find_package(QT4 REQUIRED)"<br class=""><br class=""></div><div class="">  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 class=""><br class=""></div><div class="">That way configuring your project would be as simple as:<br class=""><br class=""></div><div class="">  cd TEST_CTK-build<br class=""></div><div class="">  cmake -DCTK_DIR:PATH=/path/to/CTK-build ../CTK_TEST<br class=""></div><div class=""><br class=""><br class=""></div><div class="">All of that said, I wasn't able to reproduce your problem.<br class=""><br class=""></div><div class="">Few questions:<br class=""><br class=""></div><div class="">  a) Did you build VTK yourself or let the CTK superbuild taking care of it ?<br class=""><br class=""></div><div class="">  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 class=""></div><div class=""><br class=""><br class=""></div><div class="">Hth<br class=""></div><div class="">Jc<br class=""></div><div class=""><br class="">[1] <a href="https://github.com/commontk/CTK/commit/aee6addc33d5596026c0d47c8793270e91a95a2a" class="">https://github.com/commontk/CTK/commit/aee6addc33d5596026c0d47c8793270e91a95a2a</a><br class=""><br class="">[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 class=""></div><div class=""><br class=""></div></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Mar 16, 2015 at 4:22 PM, Quentan Qi <span dir="ltr" class=""><<a href="mailto:quentan@gmail.com" target="_blank" class="">quentan@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">Dear community members,<div class=""><br class=""></div><div class="">I am new with CTK, and want to use the CTK-VTK widget with Qt. <a href="https://github.com/commontk/Examples" target="_blank" class="">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 class=""><br class=""></div><div class="">* `CMakeLists.txt`</div><div class=""><br class=""></div><div class="">```</div><div class="">cmake_minimum_required(VERSION 2.8)<br class="">project(TEST_CTK)<br class=""><br class="">find_package(VTK REQUIRED)<br class="">include(${VTK_USE_FILE})<br class=""><br class="">find_package(CTK REQUIRED)<br class="">include(${CTK_USE_FILE})<br class=""><br class="">find_package(QT4 REQUIRED)<br class="">include(${QT_USE_FILE})<br class=""><br class="">set(SOURCE_FILES main.cpp)<br class="">add_executable(TEST_CTK ${SOURCE_FILES})<br class="">target_link_libraries(${PROJECT_NAME} ${CTK_LIBRARIES})</div><div class="">```</div><div class=""><br class=""></div><div class="">* Error information</div><div class=""><br class=""></div><div class="">```</div><div class=""><div class="">Scanning dependencies of target TEST_CTK</div><div class="">Linking CXX executable TEST_CTK</div><div class="">ld: library not found for -lvtkCommon</div><div class="">clang: error: linker command failed with exit code 1 (use -v to see invocation)</div><div class="">CMakeFiles/TEST_CTK.dir/build.make:90: recipe for target 'TEST_CTK' failed</div><div class="">gmake[3]: *** [TEST_CTK] Error 1</div><div class="">CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/TEST_CTK.dir/all' failed</div><div class="">gmake[2]: *** [CMakeFiles/TEST_CTK.dir/all] Error 2</div><div class="">CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/TEST_CTK.dir/rule' failed</div><div class="">gmake[1]: *** [CMakeFiles/TEST_CTK.dir/rule] Error 2</div><div class="">Makefile:110: recipe for target 'TEST_CTK' failed</div><div class="">gmake: *** [TEST_CTK] Error 2</div></div><div class="">```</div><div class=""><br class=""></div><div class="">* Environment: OS X 10.10 </div><div class=""><br class=""></div><div class="">Thank you very much!</div><div class=""><br class=""></div><div class="">Regards,</div><div class="">Quentan</div></div><br class="">_______________________________________________<br class="">
Ctk-developers mailing list<br class="">
<a href="mailto:Ctk-developers@public.kitware.com" class="">Ctk-developers@public.kitware.com</a><br class="">
<a href="http://public.kitware.com/mailman/listinfo/ctk-developers" target="_blank" class="">http://public.kitware.com/mailman/listinfo/ctk-developers</a><br class="">
<br class=""></blockquote></div><br class=""><br clear="all" class=""><br class="">-- <br class=""><div class="gmail_signature">+1 919 869 8849<br class=""></div>
</div>
</div></blockquote></div><br class=""></div></body></html>