<div dir="ltr"><span style="font-size:16px">Hi,</span><div style="font-size:16px"><br></div><div style="font-size:16px">I can use and include VTK libraries in my project, but I did a vtkInteractorStyleImage subclass, just overriding a method:</div><div style="font-size:16px"><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><br></pre></div><div style="font-size:16px"><br></div><div style="font-size:16px"><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">#ifndef</span><span style="color:rgb(192,192,192)"> </span>dcmInteractorStyleImage_h</pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">#define</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">dcmInteractorStyleImage_h</span></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><br></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">#include</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"vtkInteractionStyleModule.h"</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">For</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">export</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">macro</span></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">#include</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"vtkInteractorStyleImage.h"</span></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><br></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,128,0)">class</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">VTKINTERACTIONSTYLE_EXPORT</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">dcmInteractorStyle</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">public</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">vtkInteractorStyleImage</span></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">{</span></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,128,0)">public</span><span style="color:rgb(0,0,0)">:</span></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">  </span><span style="color:rgb(128,128,0)">static</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">dcmInteractorStyle</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">*</span><span style="color:rgb(0,0,0)">New</span><span style="color:rgb(0,0,0)">();</span></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">  </span><span style="color:rgb(0,0,0)">vtkTypeMacro</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(128,0,128)">dcmInteractorStyle</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">vtkInteractorStyleImage</span><span style="color:rgb(0,0,0)">);</span></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><br></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">  </span><span style="color:rgb(128,128,0)">virtual</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">void</span><span style="color:rgb(192,192,192)"> </span><span style="font-style:italic;color:rgb(0,0,0)">OnLeftButtonDown</span><span style="color:rgb(0,0,0)">();</span></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><br></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">  </span><span style="color:rgb(128,128,0)">void</span><span style="color:rgb(192,192,192)"> </span><span style="font-style:italic;color:rgb(0,0,0)">PrintSelf</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(128,0,128)">ostream</span><span style="color:rgb(0,0,0)">&</span><span style="color:rgb(192,192,192)"> </span>os<span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">vtkIndent</span><span style="color:rgb(192,192,192)"> </span>indent<span style="color:rgb(0,0,0)">);</span></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">};</span></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><br></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><br></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">#endif</span></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">----------------------------------------------------------------</span></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)"><br></span></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><div style="font-family:arial,sans-serif;white-space:normal">The thing is I use it in a Qt class. So I include this in my CMakeLists.txt:</div><div><pre style="white-space:normal;font-family:arial,sans-serif;margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,128,0)"><br></span></pre><pre style="white-space:normal;font-family:arial,sans-serif;margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,128,0)">set</span>(GENERIC_VIEW_CPP</pre><pre style="white-space:normal;font-family:arial,sans-serif;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"></span>     View/UI/dcminteractorstyle.cpp</pre><pre style="white-space:normal;font-family:arial,sans-serif;margin-top:0px;margin-bottom:0px">)</pre><pre style="white-space:normal;font-family:arial,sans-serif;margin-top:0px;margin-bottom:0px"><br></pre><pre style="white-space:normal;font-family:arial,sans-serif;margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,128,0)">SET</span>(GENERIC_VIEW_H</pre><pre style="white-space:normal;font-family:arial,sans-serif;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"></span>     View/UI/dcminteractorstyle.h</pre><pre style="white-space:normal;font-family:arial,sans-serif;margin-top:0px;margin-bottom:0px">)</pre><pre style="white-space:normal;font-family:arial,sans-serif;margin-top:0px;margin-bottom:0px"><br></pre><pre style="white-space:normal;font-family:arial,sans-serif;margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,128,0)">add_library</span>(generic<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">${GENERIC_VIEW_CPP}</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">${GENERIC_VIEW_H}</span>)</pre><pre style="white-space:normal;font-family:arial,sans-serif;margin-top:0px;margin-bottom:0px">...</pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><pre style="white-space:normal;font-family:arial,sans-serif;margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,128,0)">add_library</span>(ui_qt<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">${UI_QT_CXX}</span></pre><pre style="white-space:normal;font-family:arial,sans-serif;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"></span><span style="color:rgb(0,0,128)">     ${UI_FORM_HEADERS}</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">${UI_RESOURCES_RCC}</span></pre><font face="arial, sans-serif"><span style="white-space:normal"></span></font><pre style="white-space:normal;font-family:arial,sans-serif;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"></span><span style="color:rgb(0,0,128)">     ${MODEL_WRAPPED_HEADERS}</span></pre><font face="arial, sans-serif"><span style="white-space:normal"></span></font><pre style="white-space:normal;font-family:arial,sans-serif;margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"></span><span style="color:rgb(0,0,128)">     ${GENERIC_VIEW_CPP}</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">${GENERIC_VIEW_H} #necesary here?</span></pre><font face="arial, sans-serif"><span style="white-space:normal"></span></font><pre style="white-space:normal;font-family:arial,sans-serif;margin-top:0px;margin-bottom:0px">)</pre><pre style="white-space:normal;font-family:arial,sans-serif;margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">qt5_use_modules</span>(ui_qt<span style="color:rgb(192,192,192)"> </span>Core<span style="color:rgb(192,192,192)"> </span>Gui<span style="color:rgb(192,192,192)"> </span>Widgets)</pre><pre style="white-space:normal;font-family:arial,sans-serif;margin-top:0px;margin-bottom:0px">...</pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px">set_source_files_properties(${UI_RESOURCES_RCC} PROPERTIES GENERATED ON)
add_executable(UtilidadDICOM WIN32 main.cpp ${UI_RESOURCES_RCC})
target_link_libraries(UtilidadDICOM
    model
    ui_qt
    generic
    ${Glue}
    ${VTK_LIBRARIES}
    ${ITK_LIBRARIES}
)<font face="arial, sans-serif"><span style="white-space:normal"><br></span></font></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px">------------------------------------------------------------------</pre></pre></div></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">The error trying to compile:</span></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px">ui_qt.lib(viewerwidget.cpp.obj):-1: error: LNK2019: unresolved external symbol "public: static class dcmInteractorStyle * __cdecl dcmInteractorStyle::New(void)" (?New@dcmInteractorStyle@@SAPAV1@XZ) referenced in function "public: static class vtkSmartPointer<class dcmInteractorStyle> __cdecl vtkSmartPointer<class dcmInteractorStyle>::New(void)" (?New@?$vtkSmartPointer@VdcmInteractorStyle@@@@SA?AV1@XZ)<br></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><br></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px">ui_qt is a library declared in CMake, as you can see above.</pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><br></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px">Any ideas? Thank you.</pre></div></div>