编程与调试 -- openssl & curl

Openssl 库编译篇(Windows 平台) https://www.jianshu.com/p/d5e5e5039a40 https://www.cnblogs.com/jiaheshang/p/15098075.html

  • cmd 终端验证 nasm –version
  • cmd 终端验证 perl –version

C:\Strawberry\perl\bin\perl.exe E:\kSource\dist\nasm.exe

set PATH=%PATH%;C:\Strawberry\perl\bin;E:\kSource\dist; E: cd E:\kSource\pythonx\cppx\cppx\openssl-3.1.3

管理员启动:

curl-8.3.0.tar.gz openssl-3.1.3.tar.gz

x64md

nmake clean
perl configure VC-WIN64A no-asm --prefix="D:\3rdparty\openssl_lib\release64"

VC-WIN64A 表示 Windows 64 位系统,32 位系统请换成 VC-WIN32,若要使用 debug 版本,请使用 debug-VC-WIN64A 或 debug-VC-WIN32

nmake
nmake install

同一个目录下编译不同版本 (win32|64|release|debug) 时需要先 nmake clean

nmake clean
perl Configure debug-VC-WIN64A no-asm --prefix="D:\3rdparty\openssl_lib\debug64"
nmake
nmake install

D:\3rdparty\openssl_lib\debug64 改名为 D:\3rdparty\openssl_lib\debug64_mdd

完了之后把 makefile 文件以及 configdata.pm 文件里面的 /MDD 改为 MTD

nmake clean
nmake
nmake install

D:\3rdparty\openssl_lib\debug64 改名为 D:\3rdparty\openssl_lib\debug64_mtd

nmake clean
perl Configure VC-WIN64A no-asm --prefix="D:\3rdparty\openssl_lib\release64"
nmake
nmake install

D:\3rdparty\openssl_lib\release64 改名为 D:\3rdparty\openssl_lib\release64_md

完了之后把 makefile 文件以及 configdata.pm 文件里面的 /MD 改为 MT

nmake clean
nmake
nmake install

D:\3rdparty\openssl_lib\release64 改名为 D:\3rdparty\openssl_lib\release64_mt

https://github.com/supercodechen/win32_openssl_prebuild https://github.com/kiyolee/openssl3-win-build https://github.com/kiyolee/openssl1_1-win-build/tree/main/build-VS2019

使用 libcurl 在 windows 平台遇到的问题 https://blog.csdn.net/wquasdf/article/details/113625080 https://blog.csdn.net/q610098308/article/details/88569866 链接问题 1、首先出现的连接问题是:

  • error LNK2001: 无法解析的外部符号 __imp_curl_easy_perform
  • error LNK2001: 无法解析的外部符号 __imp_curl_easy_init
  • error LNK2001: 无法解析的外部符号 __imp_curl_slist_append
  • error LNK2001: 无法解析的外部符号 __imp_curl_slist_free_all
  • error LNK2001: 无法解析的外部符号 __imp_curl_easy_cleanup
  • error LNK2001: 无法解析的外部符号 __imp_curl_easy_setopt

解决方案:加入预编译选项:项目右键 –> 属性 –> 配置属性 –> C/C++ –> 预处理器 –> 预处理器,把 BUILDING_LIBCURL 或 CURL_STATICLIB。

// 添加依赖库
#pragma comment(lib, "ws2_32.lib")
#pragma comment(lib, "crypt32.lib")
#pragma comment(lib, "winmm.lib")
#pragma comment(lib, "wldap32.lib")

openssl3x

问题原因是 perl 太老了,安装最新的即可。

这一步得到 Makefile

Can't locate Win32/Console.pm in @INC (you may need to install the Win32::Console module) (@INC contains: third_party/openssl-3.1.4/util/perl C:/Perl64/site/lib C:/Perl64/lib third_party/openssl-3.1.4/external/perl/Text-Template-1.56/lib) at C:/Perl64/site/lib/ActivePerl/Config.pm line 400.

cpan Win32::Console ppm install Win32-Console

问题原因是 perl 太老了,安装最新的即可。

https://strawberryperl.com/ strawberry-perl-5.38.0.1-64bit.msi


参考资料快照
参考资料快照

本文短链接:
If you have any questions or feedback, please reach out .