Discussion:
[mitk-users] add VMTK to project
Admin Uniapp
2017-03-07 17:30:39 UTC
Permalink
Dear all,

I managed to change the MITK cmakes to include VMTK in the build directory,
and rebuild MITK. It all turned out to be OK and compiled fine. I then
tried to use the VMTK headers in my custom plugin, the headers can be
included and are found fine but as soons as I try to use them I can't
compile my project anymore. For example:

// VMTK

#include <vmtk/vtkvmtkPolyDataCenterlines.h>


vtkSmartPointer<vtkvmtkPolyDataCenterlines> ctrLine =
vtkSmartPointer<vtkvmtkPolyDataCenterlines>::New();


This would give me:


error: undefined reference to `vtkvmtkPolyDataCenterlines::New()'


at build time. I checked the ep directory and I can see vmtk libraries
have been built but I think

there is a linking problem between ep of MITK and my plugin.


This is driving me crazy :) any help is highly appreciated.


Many thanks

Dora
Dinkelacker, Stefan
2017-03-07 19:34:15 UTC
Permalink
Hi Dora,


do you use the mitk_create_plugin() macro? - Then just add a PACKAGE_DEPENDS VMTK to the call. See other plugin CMakeLists.txt files for examples, like [1].


Best,
Stefan


[1] https://github.com/MITK/MITK/blob/master/Plugins/org.mitk.gui.qt.diffusionimaging/CMakeLists.txt#L7?


________________________________
Von: Admin Uniapp <***@gmail.com>
Gesendet: Dienstag, 7. März 2017 18:30
An: MITK
Betreff: [mitk-users] add VMTK to project

Dear all,

I managed to change the MITK cmakes to include VMTK in the build directory, and rebuild MITK. It all turned out to be OK and compiled fine. I then tried to use the VMTK headers in my custom plugin, the headers can be included and are found fine but as soons as I try to use them I can't compile my project anymore. For example:


// VMTK

#include <vmtk/vtkvmtkPolyDataCenterlines.h>


vtkSmartPointer<vtkvmtkPolyDataCenterlines> ctrLine = vtkSmartPointer<vtkvmtkPolyDataCenterlines>::New();


This would give me:


error: undefined reference to `vtkvmtkPolyDataCenterlines::New()'


at build time. I checked the ep directory and I can see vmtk libraries have been built but I think

there is a linking problem between ep of MITK and my plugin.


This is driving me crazy :) any help is highly appreciated.


Many thanks

Dora
Admin Uniapp
2017-03-07 20:55:03 UTC
Permalink
Hi Stefan,

Thanks this fixed the issue. I was adding it under DEPENDS and not
PACKAGE_DEPENDS.

DEPENDS MitkQtWidgetsExt MitkQtWidgets MitkAlgorithmsExt MitkCore

PACKAGE_DEPENDS VMTK


all the best.


On Tue, Mar 7, 2017 at 7:34 PM, Dinkelacker, Stefan <
Post by Dinkelacker, Stefan
Hi Dora,
do you use the mitk_create_plugin() macro? - Then just add a
PACKAGE_DEPENDS VMTK to the call. See other plugin CMakeLists.txt files for
examples, like [1].
Best,
Stefan
[1] https://github.com/MITK/MITK/blob/master/Plugins/org.mitk.
gui.qt.diffusionimaging/CMakeLists.txt#L7?
________________________________
Gesendet: Dienstag, 7. MÀrz 2017 18:30
An: MITK
Betreff: [mitk-users] add VMTK to project
Dear all,
I managed to change the MITK cmakes to include VMTK in the build
directory, and rebuild MITK. It all turned out to be OK and compiled fine.
I then tried to use the VMTK headers in my custom plugin, the headers can
be included and are found fine but as soons as I try to use them I can't
// VMTK
#include <vmtk/vtkvmtkPolyDataCenterlines.h>
vtkSmartPointer<vtkvmtkPolyDataCenterlines> ctrLine = vtkSmartPointer<
vtkvmtkPolyDataCenterlines>::New();
error: undefined reference to `vtkvmtkPolyDataCenterlines::New()'
at build time. I checked the ep directory and I can see vmtk libraries
have been built but I think
there is a linking problem between ep of MITK and my plugin.
This is driving me crazy :) any help is highly appreciated.
Many thanks
Dora
Loading...