win7 64位 编译openssl出的问题

openssl-1.0.1\inc32\openssl/sm_define.h(17) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory

NMAKE : fatal error U1077: 'D:\VisualStudio2008\VC\BIN\x86_amd64\cl.EXE' : retur
n code '0x2'
Stop.

使用VS2005下的Visual Studio 2005 Command Prompt进入控制台模式(这个模式会自动设置各种环境变量)
、解压缩openssl的包,进入openssl的目录
、perl configure VC-WIN32
尽量在这个目录下执行该命令,否则找不到Configure文件,或者指定完整的Configure文件路径。
、ms\do_ms
在解压目录下执行ms\do_ms命令
、nmake -f ms\ntdll.mak编译后在openssl解压目录下执行,完成编译后。输出的文件在out32dll里面,包括应用程序的可执行文件、lib文件和dll文件
注意:在运行第五步时,cl编译器会抱怨说.\crypto\des\enc_read.c文件的read是The POSIX name for this item is deprecated(不被推荐的),建议使用_read。呵呵,我可不想将OpenSSL中的所有的read函数修改为_read。再看cl的错误代码 error C2220,于是上MSDN上查找:
warning treated as error - no object file generated
/WX tells the compiler to treat all warnings as errors. Since an error occurred, no object or executable file was generated.
是由于设置了/WX选项,将所有的警告都作为错误对待,所以。。。
于是打开OpenSSL目录下的MS目录下的ntdll.mak文件,将CFLAG的/WX选项去掉,存盘。
温馨提示:答案为网友推荐,仅供参考
相似回答