# Linking external C++ project against Slicer loadable-module

**URL:** <https://discourse.slicer.org/t/linking-external-c-project-against-slicer-loadable-module/33138>\
**Category:** Development\
**Tags:** loadable-module\
**Created:** [November 30, 2023, 8:45am UTC](https://discourse.slicer.org/t/linking-external-c-project-against-slicer-loadable-module/33138 "2023-11-30T08:45:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Federico](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/federico/32/10963_2.png) [@Federico](https://discourse.slicer.org/u/Federico)\
**Post date:** [November 30, 2023, 8:45am UTC](https://discourse.slicer.org/t/linking-external-c-project-against-slicer-loadable-module/33138/1 "2023-11-30T08:45:43Z")

</div>

Hi All,  
I saw there were a few posts that asked a similar question already but the answers were not clear enough to me unfortunately.  
Is it possible to link an external C++ exe/library against a Slicer Loadable Module (possibly only the logic)?  
If yes, how? Any documentation available, ideally for CMake?  
I saw that when building Slicer SlicerConfig.cmake and SlicerTargets.cmake are exported. I tried using these files to link against a module, cmake is fine but I have issues with the includes.  
Thank you all for your help!

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [November 30, 2023, 9:46am UTC](https://discourse.slicer.org/t/linking-external-c-project-against-slicer-loadable-module/33138/2 "2023-11-30T09:46:22Z")

</div>

I think the most typical way to do this is to create a superbuild extension. You can find lots of them by now. SlicerRT, SlicerVMTK, SlicerVirtualReality, etc.

---

<div class="post-metadata">

**Author:** ![Federico](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/federico/32/10963_2.png) [@Federico](https://discourse.slicer.org/u/Federico)\
**Post date:** [November 30, 2023, 10:25am UTC](https://discourse.slicer.org/t/linking-external-c-project-against-slicer-loadable-module/33138/3 "2023-11-30T10:25:07Z")

</div>

Hi Csaba, thanks for your answer. It seems to me, that these extensions are runtime libraries that are run from Slicer. If this is the case, this is not what I want. I want to load the needed Slicer-libraries from my application at runtime, not the other way around. Am I wrong?

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [November 30, 2023, 10:50am UTC](https://discourse.slicer.org/t/linking-external-c-project-against-slicer-loadable-module/33138/4 "2023-11-30T10:50:15Z")

</div>

Ah, I see. Sorry I misunderstood the question then.
