# unable to build static libs

**URL:** https://discourse.itk.org/t/unable-to-build-static-libs/7788
**Category:** Engineering
**Created:** [August 12, 2026, 5:12am UTC](https://discourse.itk.org/t/unable-to-build-static-libs/7788 "2026-08-12T05:12:36Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![jsemeda](https://discourse.itk.org/user_avatar/discourse.itk.org/jsemeda/32/4633_2.png) [@jsemeda](https://discourse.itk.org/u/jsemeda)
#### Post date: [August 12, 2026, 5:12am UTC](https://discourse.itk.org/t/unable-to-build-static-libs/7788/1 "2026-08-12T05:12:37Z")

</div>

when building SITK using superbuild on windows10-64 I keep ending up with dynamic libs no matter what I do. I tried editing all cmakelists files to set shared libs to 0 but that did not do anuting. I added a line in the top most cmakelists.txt file (set BUILD\_SHARED\_LIBS 0) which should have applied that key in a global manner, still did not work. Not sure how to force a static libs buil.

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [August 12, 2026, 1:29pm UTC](https://discourse.itk.org/t/unable-to-build-static-libs/7788/2 "2026-08-12T13:29:14Z")

</div>

@blowekamp is the best person to help with this. But he might be on vacation right now. Maybe @zivy or @dchen can help.

---

<div class="post-metadata">

### Author: ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)
#### Post date: [August 12, 2026, 1:43pm UTC](https://discourse.itk.org/t/unable-to-build-static-libs/7788/3 "2026-08-12T13:43:57Z")

</div>

Hello jsemeda!

What are you trying to build? A C++ library to use in a project or a wrapped language? Specifics with your goals would help assist you. Also what source code are you using? Did you download a distribution? use git and are on main, or tagged release?

With most wrapped languages the module is loaded at run type, so the wrapped language module must be a shared library. However the SimpleITK core libraries default to being static.

You should not be editing the CMakeLists.txt files.

You can use the CMake GUI to modify configuration settings. Here is a guide:

> **[Building SimpleITK on Windows — SimpleITK 2.4.0 documentation](https://simpleitk.readthedocs.io/en/v2.5.6/buildingWindows.html)**

---

<div class="post-metadata">

### Author: ![jsemeda](https://discourse.itk.org/user_avatar/discourse.itk.org/jsemeda/32/4633_2.png) [@jsemeda](https://discourse.itk.org/u/jsemeda)
#### Post date: [August 12, 2026, 4:28pm UTC](https://discourse.itk.org/t/unable-to-build-static-libs/7788/4 "2026-08-12T16:28:48Z")

</div>

Thanks for the reply. I downloaded the code with git to build a C++ static linked libraries for SimpleITK core libs. Not using wrapped languages. I did follow the windows build instructions from the docs.

I use cmake-gui, I did uncheck the build shared libs box. I used the SuperBuild, loading the cmakelists.cmake from that folder. All this did not make any difference and still getting DLLs.

---

<div class="post-metadata">

### Author: ![dchen](https://discourse.itk.org/user_avatar/discourse.itk.org/dchen/32/34_2.png) [@dchen](https://discourse.itk.org/u/dchen)
#### Post date: [September 10, 2026, 3:29pm UTC](https://discourse.itk.org/t/unable-to-build-static-libs/7788/5 "2026-09-10T15:29:46Z")

</div>

I’ve done a Windows build, using cmake-gui for a Superbuild, and I did not create any DLL files.

Here’s what my cmake-gui config looked like:

 ![Screenshot 2026-09-10 at 11.20.20 AM](https://discourse.itk.org/uploads/default/original/2X/e/ef9fbc9722f808c8bd9bb40ed42ffc1b168773c9.jpeg)

And here are the .lib files that the build created:

PS C:\sitk-build\SimpleITK-build\lib\Release\> ls

```auto
Directory: C:\sitk-build\SimpleITK-build\lib\Release

```

Mode LastWriteTime Length Name

* * *

-a---- 9/8/2026 3:04 PM 180282 SimpleITKBasicFilters0.lib  
-a---- 9/8/2026 4:30 PM 128526 SimpleITKBasicFilters1.lib  
-a---- 9/8/2026 3:04 PM 173991758 SimpleITKCommon.lib  
-a---- 9/8/2026 3:07 PM 103769440 SimpleITKIO.lib  
-a---- 9/8/2026 3:12 PM 88093262 SimpleITKRegistration.lib  
-a---- 9/8/2026 3:12 PM 6912002 SimpleITK\_ITKAnisotropicSmoothing.lib  
-a---- 9/8/2026 3:12 PM 9427528 SimpleITK\_ITKAntiAlias.lib  
-a---- 9/8/2026 3:13 PM 29436022 SimpleITK\_ITKBiasCorrection.lib  
-a---- 9/8/2026 3:16 PM 117310886 SimpleITK\_ITKBinaryMathematicalMorphology.lib  
-a---- 9/8/2026 3:16 PM 28302336 SimpleITK\_ITKClassifiers.lib  
-a---- 9/8/2026 3:16 PM 7955022 SimpleITK\_ITKColormap.lib  
-a---- 9/8/2026 3:09 PM 154091314 SimpleITK\_ITKCommon.lib  
-a---- 9/8/2026 3:17 PM 61187066 SimpleITK\_ITKConnectedComponents.lib  
-a---- 9/8/2026 3:19 PM 94579080 SimpleITK\_ITKConvolution.lib  
-a---- 9/8/2026 3:19 PM 12548460 SimpleITK\_ITKCurvatureFlow.lib  
-a---- 9/8/2026 3:22 PM 137266582 SimpleITK\_ITKDeconvolution.lib  
-a---- 9/8/2026 3:23 PM 39336978 SimpleITK\_ITKDenoising.lib  
-a---- 9/8/2026 3:24 PM 39633826 SimpleITK\_ITKDisplacementField.lib  
-a---- 9/8/2026 3:25 PM 47532516 SimpleITK\_ITKDistanceMap.lib  
-a---- 9/8/2026 3:26 PM 24754614 SimpleITK\_ITKFastMarching.lib  
-a---- 9/8/2026 3:26 PM 21281652 SimpleITK\_ITKFFT.lib  
-a---- 9/8/2026 3:27 PM 33456188 SimpleITK\_ITKImageCompare.lib  
-a---- 9/8/2026 3:28 PM 28436062 SimpleITK\_ITKImageCompose.lib  
-a---- 9/8/2026 3:30 PM 91187382 SimpleITK\_ITKImageFeature.lib  
-a---- 9/8/2026 3:31 PM 57538998 SimpleITK\_ITKImageFilterBase.lib  
-a---- 9/8/2026 3:31 PM 2133980 SimpleITK\_ITKImageFunction.lib  
-a---- 9/8/2026 3:33 PM 105380470 SimpleITK\_ITKImageFusion.lib  
-a---- 9/8/2026 3:33 PM 31706680 SimpleITK\_ITKImageGradient.lib  
-a---- 9/8/2026 3:40 PM 346680630 SimpleITK\_ITKImageGrid.lib  
-a---- 9/8/2026 3:50 PM 561793588 SimpleITK\_ITKImageIntensity.lib  
-a---- 9/8/2026 3:50 PM 25116444 SimpleITK\_ITKImageLabel.lib  
-a---- 9/8/2026 3:51 PM 50067204 SimpleITK\_ITKImageNoise.lib  
-a---- 9/8/2026 3:52 PM 20302886 SimpleITK\_ITKImageSources.lib  
-a---- 9/8/2026 3:55 PM 213442348 SimpleITK\_ITKImageStatistics.lib  
-a---- 9/8/2026 4:01 PM 254199156 SimpleITK\_ITKLabelMap.lib  
-a---- 9/8/2026 4:02 PM 31961708 SimpleITK\_ITKLabelVoting.lib  
-a---- 9/8/2026 4:04 PM 66593158 SimpleITK\_ITKLevelSets.lib  
-a---- 9/8/2026 4:15 PM 484812652 SimpleITK\_ITKMathematicalMorphology.lib  
-a---- 9/8/2026 4:17 PM 17905788 SimpleITK\_ITKPath.lib  
-a---- 9/8/2026 4:17 PM 77100054 SimpleITK\_ITKPDEDeformableRegistration.lib  
-a---- 9/8/2026 4:18 PM 36786204 SimpleITK\_ITKRegionGrowing.lib  
-a---- 9/8/2026 4:20 PM 64577966 SimpleITK\_ITKRegistrationCommon.lib  
-a---- 9/8/2026 4:21 PM 59443074 SimpleITK\_ITKReview.lib  
-a---- 9/8/2026 4:23 PM 110245250 SimpleITK\_ITKSmoothing.lib  
-a---- 9/8/2026 4:24 PM 36509212 SimpleITK\_ITKSuperPixel.lib  
-a---- 9/8/2026 4:27 PM 170009458 SimpleITK\_ITKThresholding.lib  
-a---- 9/8/2026 4:27 PM 16482344 SimpleITK\_ITKTransform.lib  
-a---- 9/8/2026 4:29 PM 67539620 SimpleITK\_ITKWatersheds.lib  
-a---- 9/8/2026 4:29 PM 10819524 SimpleITK\_LabelErodeDilate.lib  
-a---- 9/8/2026 4:30 PM 21101586 SimpleITK\_SimpleITKFilters.lib

---

<div class="post-metadata">

### Author: ![jsemeda](https://discourse.itk.org/user_avatar/discourse.itk.org/jsemeda/32/4633_2.png) [@jsemeda](https://discourse.itk.org/u/jsemeda)
#### Post date: [September 10, 2026, 7:14pm UTC](https://discourse.itk.org/t/unable-to-build-static-libs/7788/6 "2026-09-10T19:14:45Z")

</div>

Thanks for the reply, but this created dynamic release libs not static release ones like I was looking for. I tried adding /MT to the release flags and /MTd to the debug flags but this did not change anything, still getting dynamic release libs
