Skip to content

Problem with POCO_DISABLE_INTERNAL_OPENSSL=false on Windows #4139

@Mike-Altwy

Description

@Mike-Altwy

The way headers are written and organized, it is not possible at the moment to compile with this #define (I have retrieved, and updated for 7z 23.01 and VS2022, the https://github.com/pocoproject/openssl repo, that I successfully built and placed inside Poco root folder).
However, when compiling Crypto for example, I get the "External OpenSSL defined but internal headers used - possible mismatch!" message. And it is kind of normal since if we look at the header files, we have (for example when compiling Cipher.cpp):

#include "Poco/Crypto/Cipher.h"
First include in this header is
#include "Poco/Crypto/Crypto.h"

then in Crypto.h we have at the top of the file:
#define POCO_EXTERNAL_OPENSSL_SLPRO 2
and then
#include "Poco/Foundation.h"
which immediately does:
#include "Poco/Config.h"

In Config.h we have:
#if !defined(POCO_EXTERNAL_OPENSSL) && defined(POCO_EXTERNAL_OPENSSL_SLPRO)
#define POCO_EXTERNAL_OPENSSL POCO_EXTERNAL_OPENSSL_SLPRO
#endif

And then with these two lines, although I am launching CMake with POCO_DISABLE_INTERNAL_OPENSSL=false, we have POCO_EXTERNAL_OPENSSL which is now #defined. Then we go back to Crypto.h and the block of code which performs all the #pragma comment(lib, ...) fail with the above message.

For the moment, I have moved the whole block of #pragma comment above #include "Poco/Foundation.h".
Is this the right way to fix the issue or maybe there is something I overlooked?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions