Oh! Also, 

1. whenever I have problems with VS I *always* suspect precompiled header
issues. Try turning off pre-compiled headers, do a Clean, and a Rebuild, and
see if the problems go away.

2. Watch out for Unicode issues. This project is compiled "Use multi-byte
character set" which is MS-speak for "not Unicode."

Charles

-----Original Message-----
From: owner-openssl-us...@openssl.org
[mailto:owner-openssl-us...@openssl.org] On Behalf Of Charles Mills
Sent: Tuesday, September 25, 2012 9:33 PM
To: openssl-users@openssl.org
Subject: RE: error iin x509v3.h compiled with visual studio

The following compiles without error in MS VS 2010 C++. Yes, I know <string>
is in there twice: no reason, it just is.

#include "targetver.h"

// Watch out! winsock2 and friends has to be ahead of most things
#include "Ws2tcpip.h"
// Ws2tcpip always needs Ws2_32.lib. You can put it here or in the linker
input
#pragma comment (lib, "Ws2_32.lib")
#include <Mswsock.h>

#include <stdio.h>
#include <tchar.h>
#include <string>
#include <iostream>
#include <fstream>
#include <list>
#include <process.h>    /* _beginthread, _endthread */
#include <conio.h>

#include <Windows.h>
// #include "Shlwapi.h" for PathRemoveFileSpec; requires Shlwapi.lib
#include "Shlwapi.h"
#pragma comment (lib, "Shlwapi.lib")

#include <string>

// SSL
#include "openssl\ssl.h"
#include "openssl\crypto.h"
#include "openssl\err.h"
#include "openssl\rand.h"
#include "openssl\x509v3.h"

targetver.h is #include <SDKDDKVer.h> which is too long to paste here and
hopefully not the active ingredient. Probably VS version dependent anyway.

Charles

-----Original Message-----
From: owner-openssl-us...@openssl.org
[mailto:owner-openssl-us...@openssl.org] On Behalf Of Dr. Stephen Henson
Sent: Tuesday, September 25, 2012 5:23 PM
To: openssl-users@openssl.org
Subject: Re: error iin x509v3.h compiled with visual studio

On Tue, Sep 25, 2012, david preetham wrote:

>  am trying to build wpa_supplicant which is referencing openssl header 
> file x509v3.h on Visual studio 2005. while i am building compiler 
> hitting x509v3.h header file and finding hell lot of errors. Can 
> anybody please help me.
> 
> 1>D:\Interworking\wpa_supplicant-1.0.tar\wpa_supplicant-1.0\wpa_suppli
> 1>cant-1.0\src\tls\x509v3.h(192)
> : error C2059: syntax error : '('
> 
> 1>D:\Interworking\wpa_supplicant-1.0.tar\wpa_supplicant-1.0\wpa_suppli
> 1>cant-1.0\src\tls\x509v3.h(200)
> : error C2059: syntax error : 'type'
> 
> 1>D:\Interworking\wpa_supplicant-1.0.tar\wpa_supplicant-1.0\wpa_suppli
> 1>cant-1.0\src\tls\x509v3.h(204)
> : error C2059: syntax error : '}'
> 
> 1>D:\Interworking\wpa_supplicant-1.0.tar\wpa_supplicant-1.0\wpa_suppli
> 1>cant-1.0\src\tls\x509v3.h(205)
> : error C2059: syntax error : '}'
> 
> 1>D:\Interworking\wpa_supplicant-1.0.tar\wpa_supplicant-1.0\wpa_suppli
> 1>cant-1.0\src\tls\x509v3.h(211)
> : error C2061: syntax error : identifier 'GENERAL_NAME'
> 
> 1>D:\Interworking\wpa_supplicant-1.0.tar\wpa_supplicant-1.0\wpa_suppli
> 1>cant-1.0\src\tls\x509v3.h(212)
> : error C2059: syntax error : '}'
> 
> 1>D:\Interworking\wpa_supplicant-1.0.tar\wpa_supplicant-1.0\wpa_suppli
> 1>cant-1.0\src\tls\x509v3.h(231)
> : error C2059: syntax error : '('
> 
> 1>D:\Interworking\wpa_supplicant-1.0.tar\wpa_supplicant-1.0\wpa_suppli
> 1>cant-1.0\src\tls\x509v3.h(232)
> : error C2059: syntax error : '}'
> 1>D:\Interworking\wpa_supplicant-1.0.tar\wpa_supplicant-1.0\wpa_suppli
> 1>cant-1.0\src\tls\x509v3.h(249)
> : error C2061: syntax error : identifier 'DIST_POINT_NAME'
> .......continues..
> 

This is caused by clashes between the OpenSSL and some Windows header files.
There are some #undefs in various OpenSSL header files which should work
around this in crypto/x509.h for example:

#undef X509_NAME
#undef X509_CERT_PAIR
#undef X509_EXTENSIONS

but they may not be being picked up in this case or there may be some new
ones.


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to