# Does a static build ever need DllMain()?

**URL:** <https://discuss.zetetic.net/t/does-a-static-build-ever-need-dllmain/7197>\
**Category:** SQLCipher\
**Created:** [April 28, 2026, 8:00am UTC](https://discuss.zetetic.net/t/does-a-static-build-ever-need-dllmain/7197 "2026-04-28T08:00:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nbeck](https://avatars.discourse-cdn.com/v4/letter/n/97f17d/32.png) [@nbeck](https://discuss.zetetic.net/u/nbeck)\
**Post date:** [April 28, 2026, 8:00am UTC](https://discuss.zetetic.net/t/does-a-static-build-ever-need-dllmain/7197/1 "2026-04-28T08:00:04Z")

</div>

Hello!

I recently upgraded my static SQLCipher library in windows project from an older version to 4.14.0 and promptly ran into a linker error due to `DllMain()` already being defined in `MSVCRT.lib`. After some digging, I discovered the `SQLCIPHER_OMIT_DLLMAIN` flag and with that everything works fine.

My question is, shouldn’t `SQLCIPHER_OMIT_DLLMAIN` always be defined for static builds, or is there a situation where one would need to have this method in the static library? And if it isn’t needed, wouldn’t it make sense to have the flag be set automatically by the build system?

---

<div class="post-metadata">

**Author:** ![sjlombardo](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/sjlombardo/32/3_2.png) [@sjlombardo](https://discuss.zetetic.net/u/sjlombardo)\
**Post date:** [April 28, 2026, 5:28pm UTC](https://discuss.zetetic.net/t/does-a-static-build-ever-need-dllmain/7197/2 "2026-04-28T17:28:57Z")

</div>

Hello @nbeck - thanks for the feedback here. I noticed you [cross posted this to GitHub](https://github.com/sqlcipher/sqlcipher/issues/595) earlier this week, but we’ve heads down on a release and didn’t have a chance to reply. I’ve just posted a reply there, since that was the original repprt and it is code focused.

---

<div class="post-metadata">

**Author:** ![nbeck](https://avatars.discourse-cdn.com/v4/letter/n/97f17d/32.png) [@nbeck](https://discuss.zetetic.net/u/nbeck)\
**Post date:** [April 28, 2026, 6:25pm UTC](https://discuss.zetetic.net/t/does-a-static-build-ever-need-dllmain/7197/3 "2026-04-28T18:25:12Z")

</div>

Thank you for the quick response! And sorry for cross posting. I was afraid that maybe the GitHub issues weren’t watched as closely. But I probably should have linked the issue here.
