Erros while building HTTPS Server using poco library
<p>I'm trying to create simple HTTPS Server using poco libraries. I have problem with SSL layer, because I can't initialize it properly.
This is my code:</p>

<pre><code>#ifdef SSL
    // initialize SSL
    Poco::Net::initializeSSL();

    Poco::SharedPtr&lt;Poco::Net::InvalidCertificateHandler&gt; pCert =
        new Poco::Net::ConsoleCertificateHandler(false);
    Poco::Net::Context::Ptr pContext =
        new Poco::Net::Context(
            Poco::Net::Context::SERVER_USE,
            "",
            "server.pem",
            "",
            Poco::Net::Context::VERIFY_NONE,
            9,
            false,
            "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
    Poco::Net::SSLManager::instance().initializeClient(0, pCert, pContext);
#endif //SSL
    if (port == UNKNOWN_PORT)
        return 1;
    // set-up a server socket
#ifdef SSL
    SecureServerSocket svs(port, 64, pContext);
#else
    ServerSocket svs(port);
#endif //SSL
    // set-up a HTTPServer instance
    Poco::Net::HTTPServer srv(new RequestHandlerFactory, svs, new HTTPServerParams);
</code></pre>

<p>When I try to build it with MSVC2015 it gives lot of errors (see below). Building example provided with poco-libraries don't give any errors.</p>

<p>Using only <code>SecureServerSocket</code> and <code>initializeSSL</code>, without the rest gives unhandled exception.</p>

<p>Why am I getting a compile error for undefined symbols, and how do I fix it?</p>

<hr>

<pre><code>1&gt;------ Build started: Project: PocoNetServer, Configuration: Release Win32 ------
1&gt;  HTTPServer.cpp
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ossl_typ.h(178): warning C4091: 'typedef ': ignored on left of 'ssl_st' when no variable is declared
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(390): error C2065: 's': undeclared identifier
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(391): error C2059: syntax error: 'const'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(393): error C2065: 's': undeclared identifier
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(393): error C2062: type 'void' unexpected
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(402): error C2065: 's': undeclared identifier
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(402): error C2062: type 'unsigned int' unexpected
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(406): error C2065: 's': undeclared identifier
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(406): error C2062: type 'unsigned int' unexpected
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(409): error C2065: 's': undeclared identifier
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(409): error C2062: type 'unsigned int' unexpected
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(440): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(441): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(442): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(443): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(444): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(445): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(446): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(447): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(448): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(449): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(450): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(451): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(453): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(455): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(456): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(457): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(461): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(468): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(837): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(838): error C2065: 'ssl': undeclared identifier
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(839): error C2065: 'cb': undeclared identifier
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(839): error C2062: type 'int' unexpected
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(853): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(855): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(857): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(869): error C2065: 's': undeclared identifier
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(871): error C2065: 'ctx': undeclared identifier
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(873): error C2065: 's': undeclared identifier
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(873): error C2062: type 'int' unexpected
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(874): error C2065: 's': undeclared identifier
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(874): error C2062: type 'unsigned char' unexpected
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(875): error C2065: 's': undeclared identifier
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(876): error C2065: 's': undeclared identifier
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(876): error C2062: type 'unsigned char' unexpected
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(905): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(999): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1002): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1006): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1021): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1040): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1076): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1083): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1090): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1094): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1101): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1106): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1131): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1138): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1162): error C2059: syntax error: '*'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1247): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1249): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1252): error C2143: syntax error: missing ')' before '('
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1252): error C2065: 'ssl': undeclared identifier
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1252): error C2065: 'x509': undeclared identifier
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1252): error C2275: 'X509': illegal use of this type as an expression
1&gt;  D:\Programming\OpenSSL-Win32\include\openssl/ossl_typ.h(154): note: see declaration of 'X509'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1253): error C2065: 'pkey': undeclared identifier
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1253): error C2275: 'EVP_PKEY': illegal use of this type as an expression
1&gt;  D:\Programming\OpenSSL-Win32\include\openssl/ossl_typ.h(133): note: see declaration of 'EVP_PKEY'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1253): error C2206: 'SSL_CTX_set_client_cert_cb': typedef cannot be used for function definition
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1253): error C2059: syntax error: ')'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1254): error C2065: 'ssl': undeclared identifier
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1254): error C2065: 'x509': undeclared identifier
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1254): error C2275: 'X509': illegal use of this type as an expression
1&gt;  D:\Programming\OpenSSL-Win32\include\openssl/ossl_typ.h(154): note: see declaration of 'X509'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1255): error C2065: 'pkey': undeclared identifier
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1255): error C2275: 'EVP_PKEY': illegal use of this type as an expression
1&gt;  D:\Programming\OpenSSL-Win32\include\openssl/ossl_typ.h(133): note: see declaration of 'EVP_PKEY'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1255): error C2206: 'SSL_CTX_get_client_cert_cb': typedef cannot be used for function definition
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1260): error C2143: syntax error: missing ')' before '('
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1260): error C2065: 'ssl': undeclared identifier
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1262): error C2062: type 'unsigned char' unexpected
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1264): error C2059: syntax error: ')'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1266): error C2143: syntax error: missing ')' before '('
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1266): error C2065: 'ssl': undeclared identifier
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1268): error C2062: type 'unsigned char' unexpected
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1270): error C2059: syntax error: ')'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1273): error C2143: syntax error: missing ')' before '('
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1273): error C2065: 'ssl': undeclared identifier
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1274): error C2059: syntax error: 'const'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1277): error C2059: syntax error: ')'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1279): error C2143: syntax error: missing ')' before '('
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1279): error C2065: 'ssl': undeclared identifier
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1280): error C2062: type 'unsigned char' unexpected
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1284): error C2059: syntax error: ')'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1285): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1302): error C2065: 'ssl': undeclared identifier
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1302): error C2059: syntax error: 'const'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1305): error C2143: syntax error: missing ')' before '('
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1305): error C2065: 'ssl': undeclared identifier
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1306): error C2059: syntax error: 'const'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1310): error C2059: syntax error: ')'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1311): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1322): error C2143: syntax error: missing ')' before '('
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1323): error C2065: 'ssl': undeclared identifier
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1324): error C2059: syntax error: 'const'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1337): error C2059: syntax error: ')'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1338): error C2065: 'ssl': undeclared identifier
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1339): error C2065: 'psk_client_callback': undeclared identifier
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1340): error C2065: 'ssl': undeclared identifier
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1341): error C2059: syntax error: 'const'
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1356): error C2143: syntax error: missing ')' before '('
1&gt;D:\Programming\OpenSSL-Win32\include\openssl/ssl.h(1357): fatal error C1003: error count exceeds 100; stopping compilation

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
</code></pre>