Re: Getting compilation errors after upgrade to openssl 1.1.1d, errors pointing to openssl header files

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Getting compilation errors after upgrade to openssl 1.1.1d, errors pointing to openssl header files

OpenSSL - User mailing list
Hi All,
     We have recently upgraded openssl from 1.0.1h to 1.1.1d. We have compiled OpenSSL using "no-asm no-shared no-deprecated" as input to configure. 

When compiling our application (in Visual Studio 2013) by including these headers and libraries, we are seeing many errors which are pointing to header files of OpenSSL. Below are few errors:

Error 300 error C3646: 'DEPRECATEDIN_1_1_0' : unknown override specifier xxxxxx\thirdparty\openssl\include\openssl\bio.h 689 1 xxxxx

Error 301 error C2091: function returns function xxxxx\thirdparty\openssl\include\openssl\bio.h 689 1 xxxxx

Error 304 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int xxxx\thirdparty\openssl\include\openssl\bio.h 691 1 xxxx

Error 41 error C2370: 'LPCSTR' : redefinition; different storage class xxxxx\thirdparty\openssl\include\openssl\x509.h 77 1 myCrypto

Error 68 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int xxxx\thirdparty\openssl\include\openssl\x509_vfy.h 77 1 myCrypto

Error 283 error C2270: 'DEPRECATEDIN_1_1_0' : modifiers not allowed on nonmember functions xxxxx\thirdparty\openssl\include\openssl\asn1.h 555 1 xxxxxx

Error 284 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int xxxx\thirdparty\openssl\include\openssl\asn1.h 555 1 xxxxx

Error 514 error C2370: 'LPCSTR' : redefinition; different storage class xxxxxx\thirdparty\openssl\include\openssl\x509.h 77 1 xxxxx

Error 516 error C2365: 'sk_' : redefinition; previous definition was 'function' xxxxx\thirdparty\openssl\include\openssl\x509.h 77 1 xxxxxxx

We are getting hundreds of such error pointing to these header files.


Can you please help me get rid of these errors? Please let me know if I have define any flags in Visual Studio.  Compilation of our application is successful in Linux, with the same process. Build in Windows is the main issue.


Regards,

Ramaraju

Reply | Threaded
Open this post in threaded view
|

RE: Getting compilation errors after upgrade to openssl 1.1.1d, errors pointing to openssl header files

Michael Wojcik
> From: openssl-users [mailto:[hidden email]] On Behalf Of Venkata Ramaraju Vana via openssl-users
> Sent: Wednesday, February 05, 2020 00:40

> Error 300 error C3646: 'DEPRECATEDIN_1_1_0' : unknown override specifier xxxxxx\thirdparty\openssl\include\openssl\bio.h 689 1 xxxxx

You seem to be failing to include the opensslconf.h that was created as part of the build process (before including bio.h, etc). opensslconf.h is included by many of the OpenSSL headers, but not bio.h.

So either you need an explicit #include <openssl/opensslconf.h> before including any other OpenSSL headers; or you have one, but you're picking up the wrong opensslconf.h. (The latter is an easy mistake to make, as not everyone realizes opensslconf.h is a generated file and applications must include the one corresponding to the precise build they're using.)

--
Michael Wojcik
Distinguished Engineer, Micro Focus



Reply | Threaded
Open this post in threaded view
|

Re: Getting compilation errors after upgrade to openssl 1.1.1d, errors pointing to openssl header files

OpenSSL - User mailing list
Thanks for the suggestion Michael. We  have removed all duplicates of "opensslconf.h" from our code stack. With those changes, we see all errors related to "DEPRECATEDIN_1_1_0" are gone. Now, we are not seeing any errors pointing to "bio.h". However, we have some other errors, where it points to "x509.h and x509_vfy.h". Following are a few of the errors, I am seeing:

Error 209 error C2143: syntax error : missing ';' before '{' xxxxx\thirdparty\openssl\include\openssl\opensslconf.h 16 1 mycrypto
Error 210 error C2447: '{' : missing function header (old-style formal list?) xxxxxx\thirdparty\openssl\include\openssl\opensslconf.h 16 1 mycrypto
Error 179 error C2079: 'LPCSTR' uses undefined struct 'stack_st_' xxxxxx\thirdparty\openssl\include\openssl\x509.h 77 1 mycrypto
Error 184 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int xxxxxx\thirdparty\openssl\include\openssl\x509.h 77 1 mycrypto
Error 186 error C2370: 'LPCSTR' : redefinition; different storage class xxxxxx\thirdparty\openssl\include\openssl\x509.h 77 1 mycrypto
Error 188 error C2365: 'sk_' : redefinition; previous definition was 'function' xxxxxx\thirdparty\openssl\include\openssl\x509.h 77 1 mycrypto
Error 200 error C2065: 'X509_EXTENSION' : undeclared identifier xxxxxx\thirdparty\openssl\include\openssl\x509.h 85 1 mycrypto
Error 213 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int xxxxxx\thirdparty\openssl\include\openssl\x509_vfy.h 77 1 mycrypto
Error 245 error C2061: syntax error : identifier 'X509_STORE_CTX_lookup_certs_fn' xxxxxx\thirdparty\openssl\include\openssl\x509_vfy.h 315 1 mycrypto
Error 252 error C2373: 'X509_STORE_CTX_lookup_crls_fn' : redefinition; different type modifiers xxxxxx\thirdparty\openssl\include\openssl\x509_vfy.h 321 1 mycrypto
Error 274 error C2377: 'ASN1_INTEGER' : redefinition; typedef cannot be overloaded with any other symbol xxxxxx\thirdparty\openssl\include\openssl\x509_vfy.h 386 1 mycrypto


Error in "opensslconf.h" points to 'extern "C"' statement the following code:
#ifdef  __cplusplus
extern "C" {
#endif

Can you please suggest us to remove these errors. 
Appreciate your help on this.


Regards,
Ramaraju



On Thu, Feb 6, 2020 at 12:27 AM Michael Wojcik <[hidden email]> wrote:
> From: openssl-users [mailto:[hidden email]] On Behalf Of Venkata Ramaraju Vana via openssl-users
> Sent: Wednesday, February 05, 2020 00:40

> Error 300 error C3646: 'DEPRECATEDIN_1_1_0' : unknown override specifier xxxxxx\thirdparty\openssl\include\openssl\bio.h 689 1 xxxxx

You seem to be failing to include the opensslconf.h that was created as part of the build process (before including bio.h, etc). opensslconf.h is included by many of the OpenSSL headers, but not bio.h.

So either you need an explicit #include <openssl/opensslconf.h> before including any other OpenSSL headers; or you have one, but you're picking up the wrong opensslconf.h. (The latter is an easy mistake to make, as not everyone realizes opensslconf.h is a generated file and applications must include the one corresponding to the precise build they're using.)

--
Michael Wojcik
Distinguished Engineer, Micro Focus



Reply | Threaded
Open this post in threaded view
|

RE: Getting compilation errors after upgrade to openssl 1.1.1d, errors pointing to openssl header files

Michael Wojcik
> From: Venkata Ramaraju Vana [mailto:[hidden email]]
> Sent: Thursday, February 06, 2020 03:01

> Error 209 error C2143: syntax error : missing ';' before '{'
>
> Error in "opensslconf.h" points to 'extern "C"' statement the following code:
> #ifdef  __cplusplus
> extern "C" {
> #endif

That error suggests you're compiling a C source file that includes <opensslconf.h> with __cplusplus defined. (Don't do that. __cplusplus should only be defined by the compiler itself, and only when compiling C++ source files.)

Or you're using an extremely old C++ compiler. Or there's something really wrong with your compiler.

Whatever this is, I can't see how it's an OpenSSL problem.

--
Michael Wojcik
Distinguished Engineer, Micro Focus