# static compiled example exits with segfault

**URL:** <https://discourse.itk.org/t/static-compiled-example-exits-with-segfault/2744>\
**Category:** Beginner Questions\
**Tags:** cmake\
**Created:** [February 19, 2020, 2:36pm UTC](https://discourse.itk.org/t/static-compiled-example-exits-with-segfault/2744 "2020-02-19T14:36:52Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)\
**Post date:** [February 19, 2020, 3:13pm UTC](https://discourse.itk.org/t/static-compiled-example-exits-with-segfault/2744/2 "2020-02-19T15:13:01Z")

</div>

Hello @Vincent,

Welcome to the ITK community! 🌞

> [@Vincent](#):
>
> DCMAKE\_EXE\_LINKER\_FLAGS=“-static”

This can cause issues. If a binary that just works across many linux platforms is desired, check out [dockbuild](https://github.com/dockbuild/dockbuild).

Otherwise, `-static` is used with the executables generated, add `-DITK_DYNAMIC_LOADING:BOOL=OFF` to your ITK CMake configuration flags. But, dockbuild is preferred :-).

HTH,  
Matt

---

_[View the full topic](https://discourse.itk.org/t/static-compiled-example-exits-with-segfault/2744)._
