# Build Light Weight Robot IGT module

**URL:** <https://discourse.slicer.org/t/build-light-weight-robot-igt-module/5878>\
**Category:** Support\
**Created:** [February 21, 2019, 10:07pm UTC](https://discourse.slicer.org/t/build-light-weight-robot-igt-module/5878 "2019-02-21T22:07:54Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mary7291](https://avatars.discourse-cdn.com/v4/letter/m/48db29/32.png) [@Mary7291](https://discourse.slicer.org/u/Mary7291)\
**Post date:** [February 21, 2019, 10:07pm UTC](https://discourse.slicer.org/t/build-light-weight-robot-igt-module/5878/1 "2019-02-21T22:07:54Z")

</div>

Operating system:Win 7  
Slicer version: build slicer V. 4.11  
Expected behavior:  
Actual behavior:

Hello everybody,

I tried to build the Light Weight Robot IGT module after building the Slicer on my system. After fixing all the compilation errors, I faced with error LNK 2005 as follows which i have no idea how to fix.

* * *

Error LNK2005 “public: static class vtkIGTLToMRMLString \* \_\_cdecl vtkIGTLToMRMLString::New(void)” (?New@vtkIGTLToMRMLString@@SAPEAV1@XZ) already defined in vtkIGTLToMRMLString.obj

project: vtkSlicerLightWeightRobotIGTModuleMRML

file:vtkSlicerOpenIGTLinkIFModuleMRML.lib(vtkSlicerOpenIGTLinkIFModuleMRML.dll)

* * *

This error is appeared when i add the “vtkSlicerOpenIGTLinkIFModuleMRML.lib” to the linker of the “vtkSlicerLightWeightRobotIGTModuleMRML” project in configuration properties in visual studio.

I would be so appreciated if anyone could help me to fix the error.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [February 21, 2019, 10:23pm UTC](https://discourse.slicer.org/t/build-light-weight-robot-igt-module/5878/2 "2019-02-21T22:23:27Z")

</div>

Support for STRING message type is now part of OpenIGTLinkIF. You can remove vtkIGTLToMRMLString class from LightWeightRobotIGT.

vtkIGTLToMRMLString in LightWeightRobotIGT saved text data to vtkMRMLAnnotationTextNode, while OpenIGTLinkIF uses [vtkMRMLTextNode](https://github.com/openigtlink/SlicerOpenIGTLink/blob/master/OpenIGTLinkIF/MRML/vtkMRMLTextNode.h), so LightWeightRobotIGT need to be updated accordingly.

---

<div class="post-metadata">

**Author:** ![Mary7291](https://avatars.discourse-cdn.com/v4/letter/m/48db29/32.png) [@Mary7291](https://discourse.slicer.org/u/Mary7291)\
**Post date:** [February 22, 2019, 6:52pm UTC](https://discourse.slicer.org/t/build-light-weight-robot-igt-module/5878/3 "2019-02-22T18:52:35Z")

</div>

Thanks Mr. Lasso,  
I can fix the errors and build the module based on your suggestion.

But another problem is how to use and install the module in Slicer. I add the path containing the following folder to the “edit—application settings—modules—additional module paths” and then restart the Slicer.  
\*\*  
the path is:  
E:\LightWeightRobotIGT\B\lib\Slicer-4.11\qt-loadable-modules  
\*\*  
But it seems that there is no changes after restarting the Slicer and even there is no additional module in all modules.

I am waiting for your guidance…

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [February 22, 2019, 8:09pm UTC](https://discourse.slicer.org/t/build-light-weight-robot-igt-module/5878/4 "2019-02-22T20:09:01Z")

</div>

You need to add SlicerOpenIGTLink extension paths to additional module paths. Third-party DLLs need to be added to the same folder where module DLLs are or you need to use the generated additional launcher settings .ini file (that should take care of both the additional module paths and third-party library paths).

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [February 22, 2019, 8:10pm UTC](https://discourse.slicer.org/t/build-light-weight-robot-igt-module/5878/5 "2019-02-22T20:10:13Z")

</div>

Once things are working, please send a pull request with your changes so that we can review, give feedback, merge them. Thank you!

---

<div class="post-metadata">

**Author:** ![Mary7291](https://avatars.discourse-cdn.com/v4/letter/m/48db29/32.png) [@Mary7291](https://discourse.slicer.org/u/Mary7291)\
**Post date:** [February 27, 2019, 8:18pm UTC](https://discourse.slicer.org/t/build-light-weight-robot-igt-module/5878/6 "2019-02-27T20:18:00Z")

</div>

Dear Mr. Lasso,

you mean that the OpenIGTLink is the third party for the LightWeightRobotIGT?  
I built the OpenIGTLink but unfortunately there is no .dll file in OpenIGTLink library folder, there exist just .lib and .exp files.

Besides, how can i use the additional launcher settings .ini file?

I am so interesting to use this module and Slicer and i would be so appreciated if you could help me through.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [February 27, 2019, 8:20pm UTC](https://discourse.slicer.org/t/build-light-weight-robot-igt-module/5878/7 "2019-02-27T20:20:12Z")

</div>

@Sunderlandkyl could you help @Mary7291 with details steps? Thanks!

---

<div class="post-metadata">

**Author:** ![Sunderlandkyl](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sunderlandkyl/32/79987_2.png) [@Sunderlandkyl](https://discourse.slicer.org/u/Sunderlandkyl)\
**Post date:** [February 27, 2019, 8:44pm UTC](https://discourse.slicer.org/t/build-light-weight-robot-igt-module/5878/8 "2019-02-27T20:44:19Z")

</div>

Note that the path for a module should look like the following:  
E:\d\s\SlicerOpenIGTLinkD\inner-build\lib\Slicer-4.11\qt-loadable-modules\Debug  
If your extension includes Python modules, then you also need to add:  
E:\d\s\SlicerOpenIGTLinkD\inner-build\lib\Slicer-4.11\qt-scripted-modules

You need to specify the additional-module-paths for SlicerOpenIGTLink, as well as one of the following:

1. Within SlicerOpenIGTLink build, third-party DLLs are in the folder:  
E:\d\s\SlicerOpenIGTLinkD/bin/Release or E:\d\s\SlicerOpenIGTLinkD/bin/Debug  
and  
Copy the DLLs from the folder above to:  
E:\d\s\SlicerOpenIGTLinkD\inner-build\lib\Slicer-4.11\qt-loadable-modules\Release or E:\d\s\SlicerOpenIGTLinkD\inner-build\lib\Slicer-4.11\qt-loadable-modules\Debug

2. You can start Slicer with the following option:  
Slicer.exe --launcher-additional-settings E:\d\s\SlicerOpenIGTLinkD\inner-build\AdditionalLauncherSettings.ini

---

<div class="post-metadata">

**Author:** ![Mary7291](https://avatars.discourse-cdn.com/v4/letter/m/48db29/32.png) [@Mary7291](https://discourse.slicer.org/u/Mary7291)\
**Post date:** [February 28, 2019, 9:42am UTC](https://discourse.slicer.org/t/build-light-weight-robot-igt-module/5878/9 "2019-02-28T09:42:44Z")

</div>

Thanks Mr. Sunderland,

The SlicerOpenIGTLink is now added to Slicer modules based on your guidance.

I want to use the LightWeightRobotIGT module which it’s source code can be found here:  
[https://github.com/SNRLab/LightWeightRobotIGT](https://github.com/SNRLab/LightWeightRobotIGT) .  
The qt loadable modules are built after building the module in VS2015. The path to the lib folder is as follows:  
E:\LightWeightRobotIGT\B\lib\Slicer-4.11\qt-loadable-modules\Release.

Would you please guide me through the installing the module in Slicer?

---

<div class="post-metadata">

**Author:** ![Sunderlandkyl](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sunderlandkyl/32/79987_2.png) [@Sunderlandkyl](https://discourse.slicer.org/u/Sunderlandkyl)\
**Post date:** [February 28, 2019, 4:51pm UTC](https://discourse.slicer.org/t/build-light-weight-robot-igt-module/5878/10 "2019-02-28T16:51:29Z")

</div>

Can you upload your changes to the LightWeightRobotIGT to a GitHub branch somewhere?

If everything compiles correctly, you should only need to add E:\LightWeightRobotIGT\B\lib\Slicer-4.11\qt-loadable-modules\Release to the additional-module-paths.

---

<div class="post-metadata">

**Author:** ![Mary7291](https://avatars.discourse-cdn.com/v4/letter/m/48db29/32.png) [@Mary7291](https://discourse.slicer.org/u/Mary7291)\
**Post date:** [February 28, 2019, 7:40pm UTC](https://discourse.slicer.org/t/build-light-weight-robot-igt-module/5878/11 "2019-02-28T19:40:41Z")

</div>

(Scenario 1) I was built the LightWeightRobotIGT (LWRIGT) module based on the OpenIGTLink and OpenIGTLinkIF which can be found from:  
[https://github.com/openigtlink/OpenIGTLink](https://github.com/openigtlink/OpenIGTLink),  
and  
[https://github.com/openigtlink/OpenIGTLinkIF](https://github.com/openigtlink/OpenIGTLinkIF).  
This way and after building the above two modules, the LWRIGT was compiled in VS2015 and the errors were fixed step by step by adding the header and library files to the corresponding project in VS.

(Scenario 2) But now and based on your guidance i found another url as: [https://github.com/openigtlink/SlicerOpenIGTLink](https://github.com/openigtlink/SlicerOpenIGTLink), which i could load the OpenIGTLink Extension to the module paths after building this extension.

Please let me know if there is any difference in building the LWRIGT module based on these two scenarios…

---

<div class="post-metadata">

**Author:** ![Sunderlandkyl](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sunderlandkyl/32/79987_2.png) [@Sunderlandkyl](https://discourse.slicer.org/u/Sunderlandkyl)\
**Post date:** [February 28, 2019, 8:35pm UTC](https://discourse.slicer.org/t/build-light-weight-robot-igt-module/5878/12 "2019-02-28T20:35:19Z")

</div>

OpenIGTLink and OpenIGTLinkIF are compiled as part of the SlicerOpenIGTLink extension.

What you will need to do is add SlicerOpenIGTLink as a dependency of LightWeightRobotIGT.  
For example, the SlicerIGSIO extension depends on the Sequences extension:([https://github.com/IGSIO/SlicerIGSIO/blob/master/CMakeLists.txt](https://github.com/IGSIO/SlicerIGSIO/blob/master/CMakeLists.txt))

You will then need to get LightWeightRobotIGT to compile using SlicerOpenIGTLink instead of using openigtlink/OpenIGTLinkIF.

---

<div class="post-metadata">

**Author:** ![Mary7291](https://avatars.discourse-cdn.com/v4/letter/m/48db29/32.png) [@Mary7291](https://discourse.slicer.org/u/Mary7291)\
**Post date:** [March 1, 2019, 8:43pm UTC](https://discourse.slicer.org/t/build-light-weight-robot-igt-module/5878/13 "2019-03-01T20:43:56Z")

</div>

I am trying to build the module based on your suggestion by adding these two lines to the CMake:

* * *

set(EXTENSION\_DEPENDS “SlicerOpenIGTLink”)  
and  
find\_package(SlicerOpenIGTLink REQUIRED

* * *

But after compiling the project in VS, the error which says that it can not open the ‘vtkIGTLTOMRMLBASE.h’ file is appeared. On the other hand there is no such file in any of the ‘Slicer OpenIGTLink’ folders to add to the VC/VC++ configuration properties.

would you please help me to substitute the file or please let me know that if something wrong will happen by adding the ‘vtkIGTLTOMRMLBASE.h’ file from ‘OpenIGTLinkIF’ folder??  
@lassoan@Sunderlandkyl

---

<div class="post-metadata">

**Author:** ![Sunderlandkyl](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sunderlandkyl/32/79987_2.png) [@Sunderlandkyl](https://discourse.slicer.org/u/Sunderlandkyl)\
**Post date:** [March 1, 2019, 9:08pm UTC](https://discourse.slicer.org/t/build-light-weight-robot-igt-module/5878/14 "2019-03-01T21:08:31Z")

</div>

What is vtkIGTLTOMRMLBASE used for?

The process to convert IGTL messages to MRML nodes is already done by SlicerOpenIGTLink.
