轉載: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"