转载:http://blog.csdn.net/liuyu60305002/article/details/7742897
在Windows环境中使用 X509_NAME时,会因为include的顺序导致冲突。
如先
#include "openssl/x509.h"
#include "windows.h"
X509_NAME *Name = X509_get_subject_name(p); //就会发生冲突 ,在windows中定义为 #define X509_NAME ((LPCSTR) 7) 跟openssl的不一致。
因此需要调换#include 的顺序,用openssl/x509.h 覆盖wincrypt.h中的X509_NAME。
#include "windows.h"
...
#include "openssl/x509.h"