libevent 编译与安装二 (WIN10 visual studio2019, ubuntu) x64

libevent 编译与安装二 (WIN10 visual studio2019, ubuntu) x64,第1张

libevent 编译与安装二 (WIN10 visual studio2019, ubuntu) x64

文章目录
      • 准备工作
      • 编译zlib (x64)
      • 编译openssl (x64)
      • 编译libevent (x64)

关于编译错误解决请查看前置文章:libevent 编译与安装 (WIN10 visual studio2019, ubuntu)

准备工作

编译x64使用工具:x64 Native Tools Command prompt for VS 2019

准备安装包依旧为:

ActivePerl-5.24.3.2404-MSWin32-x64-404865.exe # 编译openssl工具
nasm-2.13.03-win64.zip                        # 编译openssl工具

libevent-2.1.8-stable.tar.gz
openssl-1.1.1.tar.gz
zlib-1.2.11.tar.gz

解压至工作文件夹:D:libevent_project
编译后存放文件夹:D:libevent_projectbuild_project_vs2019_64

编译zlib (x64)

工作文件夹下 新建build_zlib_vs2019_64.bat

@echo "==========start build zlib============"
set VS="C:Program Files (x86)Microsoft Visual Studio2019CommunityVCAuxiliaryBuildvcvars64.bat"
set OUT="D:libevent_projectbuild_project_vs2019_64zlib"
call %VS%
cd zlib-1.2.11
nmake /f win32Makefile.msc clean
nmake /f win32Makefile.msc AS=ml64 LOC="-DASMV -DASMINF -I." OBJA="inffasx64.obj gvmat64.obj inffas8664.obj"
md %OUT%lib
md %OUT%bin
md %OUT%include
copy /Y *.lib %OUT%lib
copy /Y *.h %OUT%include
copy /Y *.dll %OUT%bin
copy /Y *.exe %OUT%bin
@echo "==========end build zlib============"
pause
编译openssl (x64)

工作文件夹下 新建build_openssl_vs2019_64.bat,使用管理员身份执行

@echo "==========start build openssl============"
@echo "-------please use ROOT run -------"
timeout /T 3
set VS="C:Program Files (x86)Microsoft Visual Studio2019CommunityVCAuxiliaryBuildvcvars64.bat"
set OUT="D:libevent_projectbuild_project_vs2019_64openssl"
call %VS%
D:
cd D:libevent_projectopenssl-1.1.1
perl Configure VC-WIN64A no-asm --prefix=%OUT%
nmake clean
nmake
nmake install
@echo "==========end build openssl============"
pause
编译libevent (x64)

修改Makefile.nmake第三十行为:LIBFLAGS=/nologo /MACHINE:X64

工作文件夹下 新建build_libevent_vs2019_64.bat,使用管理员身份执行

@echo "==========start build libevent============"
set VS="C:Program Files (x86)Microsoft Visual Studio2019CommunityVCAuxiliaryBuildvcvars64.bat"
set OUT="D:libevent_projectbuild_project_vs2019_64libevent"
call %VS%
cd D:libevent_projectlibevent-2.1.8-stable
nmake /f Makefile.nmake clean
nmake /f Makefile.nmake OPENSSL_DIR=D:libevent_projectbuild_project_vs2019_64openssl
md %OUT%lib
md %OUT%bin
md %OUT%include
copy /Y *.lib %OUT%lib
xcopy /S/Y include %OUT%include
xcopy /S/Y WIN32-Codenmake %OUT%include
copy /Y *.dll %OUT%bin
copy /Y *.exe %OUT%bin
@echo "==========end build libevent============"
pause

欢迎分享,转载请注明来源:内存溢出

原文地址:https://www.54852.com/zaji/3999345.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-10-22
下一篇2022-10-22

发表评论

登录后才能评论

评论列表(0条)

    保存