How to configure static poco with static openssl but shared windows libraries on windows? #4469
Replies: 1 comment 2 replies
-
This is best addressed separately for the openssl libs - expecting them to follow the same binaries naming convention as we do obviously doesn't work.
this is a leftover from the times when we were building our own windows openssl binaries; @matejk should be removed unless someone is interested to revive this (openssl build is a horrible nightmare, probably best to just rely on external distributions)
same as above - looking for openssl libs should have its own logic, not relay on poco binary naming convention |
Beta Was this translation helpful? Give feedback.
-
In our Windows project we are using static poco and static openssl but the windows libraries in shared mode.
We use:
OpenSSL is compiled and build
-openssl_release 3.2.1 -vs_version 150 -config release -platform x64 -library static
Poco is build with
BUILD_SHARED_LIBS=OFF
OPENSSL_USE_STATIC_LIBS=ON
OPENSSL_ROOT_DIR=<path to openssl>
so far so good (one remark see below at the end).
But if we build now our project using "/MD" we got the link error libcrypt.lib not found (and libssl.lib).
After investigation I found in Crypto\include\Poco\Crypto\Crypto.h:
After a quick patch in the else part to
it worked.
The question is if we do something in general wrong or is this situation just not considered yet.
A solution might also be to use OPENSSL_USE_STATIC_LIBS instead of _DLL in the #if condition, but I don't have the overview of all OS flavors if this would work.
Remark:
Is the warning:
External OpenSSL defined but internal headers used - possible mismatch!
intended in our case? For me it sounds doing something wrong.
OffTopic:
Instead of "mt" I had to patch it to "_static" and also in the openssl build script as FindOpenSSl.cmake didn't found libs with "mt". But this is something I will investigate further.
Beta Was this translation helpful? Give feedback.
All reactions