2

I need to add SSL capability to an existing C++ socket client application. I've downloaded and installed OpenSSL, and the appropriate libs and includes are in my Visual Studio folder. Forgive the age of the dev environment (VC++ 6.0) but it's a legacy project, and only runs on Windows XP.

After adding this line:

// OpenSSL implementation for secure socket
#include <openssl/ssl.h>

To one of my header files, I now get this compile error:

c:\program files\microsoft visual studio\vc98\include\openssl\rsa.h(410) : error C2143: syntax error : missing ')' before 'constant'

c:\program files\microsoft visual studio\vc98\include\openssl\rsa.h(410) : error C2143: syntax error : missing ';' before 'constant'

c:\program files\microsoft visual studio\vc98\include\openssl\rsa.h(410) : fatal error C1004: unexpected end of file found

The line of the file causing the error is in rsa.h

int RSA_verify_PKCS1_PSS(RSA *rsa, const unsigned char *mHash,          
            const EVP_MD *Hash, const unsigned char *EM, int sLen);

Any ideas what could be causing this error?

Thanks

Jon
  • 3,230
  • 1
  • 16
  • 28
  • 3
    I'm going to guess somewhere in your translation unit (that'd be the source file *and* all the `#include`s it includes, and that they include, etc..) you have a `#define` that is defining one of these symbols: `RSA`, `EVP_MD`, or `EM` as a macro constant. Eg: `#define RSA 1` . Which one I leave to you to find. Just a guess mind you, but worth pursuing at least a little. – WhozCraig Aug 18 '14 at 16:30
  • put lines before this include that says #define RSA xx #define mHash xx etc. Teh compiler will tell you if this is a repeated symbol declaration and where the conflicting define is – pm100 Aug 18 '14 at 16:53
  • @Mangist - Whoz likely diagnosed it. You should re-arrange your headers. For example, include the Windows headers first, and then include the OpenSSL headers (or vice-versa). – jww Aug 18 '14 at 17:41
  • OK thanks. The only define I found out of those 3 was this one: #define EM (BYTE)0X19 it's in one of the serial comms header files. How would I fix this so that the OpenSSL header is not conflicting? (edit: I just commented out the #define, because it's just one of the ASCII codes and it's not used). Thanks again everyone for your help) – Jon Aug 18 '14 at 17:51

0 Answers0