转载:http://blog.youkuaiyun.com/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"

本文介绍在Windows环境下使用OpenSSL的X509_NAME结构时遇到的问题及解决办法,主要是由于包含文件顺序不当引起的冲突,并提供了解决方案。
4818

被折叠的 条评论
为什么被折叠?



