# Is it possible to build VTK as both static and dynamic libs

**URL:** https://discourse.vtk.org/t/is-it-possible-to-build-vtk-as-both-static-and-dynamic-libs/2119
**Category:** Support
**Created:** [November 21, 2019, 8:04am UTC](https://discourse.vtk.org/t/is-it-possible-to-build-vtk-as-both-static-and-dynamic-libs/2119 "2019-11-21T08:04:00Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![cesss](https://discourse.vtk.org/user_avatar/discourse.vtk.org/cesss/32/1418_2.png) [@cesss](https://discourse.vtk.org/u/cesss)
#### Post date: [November 21, 2019, 8:04am UTC](https://discourse.vtk.org/t/is-it-possible-to-build-vtk-as-both-static-and-dynamic-libs/2119/1 "2019-11-21T08:04:01Z")

</div>

If I enable BUILD\_SHARED\_LIBS, then static libs are not built. Is it possible to build both dynamic and static? (I need both: dynamic for lab tests, and static for app release to third parties).

Thanks a lot!

cesss

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [November 21, 2019, 2:09pm UTC](https://discourse.vtk.org/t/is-it-possible-to-build-vtk-as-both-static-and-dynamic-libs/2119/2 "2019-11-21T14:09:51Z")

</div>

Yes, you can use two different build directories with the same source tree. There’s no support for building both in the same build tree.

---

<div class="post-metadata">

### Author: ![cesss](https://discourse.vtk.org/user_avatar/discourse.vtk.org/cesss/32/1418_2.png) [@cesss](https://discourse.vtk.org/u/cesss)
#### Post date: [November 21, 2019, 3:02pm UTC](https://discourse.vtk.org/t/is-it-possible-to-build-vtk-as-both-static-and-dynamic-libs/2119/3 "2019-11-21T15:02:42Z")

</div>

Thanks!
