Closed chunyunchen closed 6 years ago
我这边没有Windows 8.1的环境,我用的是Windows 10、Visual studio 2013 x64编译,没有发现问题。
E:\TASSL-master\TASSL-master>cl 用于 x64 的 Microsoft (R) C/C++ 优化编译器 18.00.40629 版 版权所有(C) Microsoft Corporation。 保留所有权利。
用法: cl [ 选项... ] 文件名... [ /link 链接选项... ]
E:\TASSL-master\TASSL-master>ver
Microsoft Windows [版本 10.0.16299.125]
E:\TASSL-master\TASSL-master>perl Configure VC-WIN64A > nul
E:\TASSL-master\TASSL-master>ms\do_win64a.bat
E:\TASSL-master\TASSL-master>perl util\mkfiles.pl 1>MINFO
E:\TASSL-master\TASSL-master>cmd /c "nasm -f win64 -v" 1>NUL 2>&1
E:\TASSL-master\TASSL-master>if 1 NEQ 0 goto ml64
E:\TASSL-master\TASSL-master>perl ms\uplink-x86_64.pl masm 1>ms\uptable.asm
E:\TASSL-master\TASSL-master>ml64 -c -Foms\uptable.obj ms\uptable.asm Microsoft (R) Macro Assembler (x64) Version 12.00.40629.0 Copyright (C) Microsoft Corporation. All rights reserved.
Assembling: ms\uptable.asm
E:\TASSL-master\TASSL-master>perl util\mk1mf.pl VC-WIN64A 1>ms\nt.mak
E:\TASSL-master\TASSL-master>perl util\mk1mf.pl dll VC-WIN64A 1>ms\ntdll.mak
E:\TASSL-master\TASSL-master>perl util\mkdef.pl 32 libeay 1>ms\libeay32.def
E:\TASSL-master\TASSL-master>perl util\mkdef.pl 32 ssleay 1>ms\ssleay32.def
E:\TASSL-master\TASSL-master>
建议你使用ZIP包的格式下载源码,然后再解压缩、编译。 应该和操作系统无关,最有可能的是perl的问题。或者,你可以试着使用ActiveState Perl 5看看。
@jntass 谢谢您的帮助! 使用ActiveState Perl 5.24.3后,上面的错误解决了,但出现了“模块计算机类型“X86”与目标计算机类型“X64”冲突”的错误。
编译步骤如下:
perl Configure VC-WIN64A ms\do_win64a nmake -f ms\ntdll.mak Microsoft (R) 程序维护实用工具 12.00.21005.1 版 版权所有 (C) Microsoft Corporation。 保留所有权利。
Building OpenSSL perl .\util\copy-if-different.pl ".\crypto\buildinf.h" "tmp32dll\buildin f.h" Copying: ./crypto/buildinf.h to tmp32dll/buildinf.h perl .\util\copy-if-different.pl ".\crypto\opensslconf.h" "inc32\openssl \opensslconf.h" Copying: ./crypto/opensslconf.h to inc32/openssl/opensslconf.h rc /fo"tmp32dll\libeay32.res" /d CRYPTO ms\version32.rc Microsoft (R) Windows (R) Resource Compiler Version 6.3.9600.17336 Copyright (C) Microsoft Corporation. All rights reserved.
link /nologo /subsystem:console /opt:ref /debug /dll /out:out32dll\libea
y32.dll /def:ms/LIBEAY32.def @C:\Users\ccylh\AppData\Local\Temp\nm8AFC.tmp tmp32dll\uplink.obj : fatal error LNK1112: 模块计算机类型“X86”与目标计算机类型 “x64”冲突 NMAKE : fatal error U1077: “"D:\ProgramFiles\Microsoft Visual Studio 12.0\VC\BI N\link.EXE"”: 返回代码“0x458” Stop.
麻烦请帮忙再看看新的错误,谢谢!
@jntass 谢谢您的大力帮助,已成功编译windows操作系统下的64位和32位动态库。
编译命令行的打开路径:系统开始-->Visual Studio Tools目录-->"VS2013 x64 兼容工具命令提示"(64位编译)或“VS2013 x86 本机工具命令提示”(32位编译)
所有的编译,都是在VS2013下执行的,下面是编译过程中碰到的一些问题和我的解决办法:
问题:no rule for ssl\ at util\mk1mf.pl line 1048 答案:更新Perl 5.22 到 ActiveState Perl 5.24.3
问题:如何优化编译 答案:执行ms\do_win64a(64位)或ms\do_ms(32位)后,生成文件ms\ntdll.mak,修改“CFLAG= /MD /Ox ...”为“CFLAG= /MT /Ox ...”
问题:模块计算机类型“X86”与目标计算机类型“x64”冲突或模块计算机类型“x64”与目标计算机类型 “X86”冲突 答案:执行ms\do_win64a(64位)或ms\do_ms(32位)后,生成文件ms\ntdll.mak,修改TMP_D和OUT_D值来设置临时编译目录(目录不存在会自动生成)
问题:32位编译时,出现类似“object对象文件没有生成”的错误 答案:不用管,这个错应该是编译测试程序相关。在OUT_D已经生成了动态库,只是不能执行install把库安装到--prefix指定的目录,手动将库拷贝到需要调用的目录即可。
编译报错时的执行步骤如下:
执行结果如下: d:\agile\developer\3thparty\src\TASSL>ms\do_win64a d:\agile\developer\3thparty\src\TASSL>perl util\mkfiles.pl 1>MINFO d:\agile\developer\3thparty\src\TASSL>cmd /c "nasm -f win64 -v" 1>NUL 2>&1 d:\agile\developer\3thparty\src\TASSL>if 1 NEQ 0 goto ml64 d:\agile\developer\3thparty\src\TASSL>perl ms\uplink-x86_64.pl masm 1>ms\uptabl e.asm d:\agile\developer\3thparty\src\TASSL>ml64 -c -Foms\uptable.obj ms\uptable.asm Microsoft (R) Macro Assembler (x64) Version 11.00.60610.1 Copyright (C) Microsoft Corporation. All rights reserved. Assembling: ms\uptable.asm d:\agile\developer\3thparty\src\TASSL>perl util\mk1mf.pl VC-WIN64A 1>ms\nt.mak no rule for ssl\ at util\mk1mf.pl line 1048. d:\agile\developer\3thparty\src\TASSL>perl util\mk1mf.pl dll VC-WIN64A 1>ms\ntd ll.mak no rule for ssl\ at util\mk1mf.pl line 1048. d:\agile\developer\3thparty\src\TASSL>perl util\mkdef.pl 32 libeay 1>ms\libeay3 2.def File ssl/tls1.h: cannot parse: ()
INFO::;
File ssl/tls1.h: cannot parse: () #INFO::; <<<===# 到这里一直卡住,没继续执行