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

2021/10/20 7:11:01

本文主要是介绍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_project\build_project_vs2019_64

编译zlib (x64)

工作文件夹下 新建build_zlib_vs2019_64.bat

@echo "==========start build zlib============"
set VS="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
set OUT="D:\libevent_project\build_project_vs2019_64\zlib"
call %VS%
cd zlib-1.2.11
nmake /f win32\Makefile.msc clean
nmake /f win32\Makefile.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 Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
set OUT="D:\libevent_project\build_project_vs2019_64\openssl"
call %VS%
D:
cd D:\libevent_project\openssl-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 Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
set OUT="D:\libevent_project\build_project_vs2019_64\libevent"
call %VS%
cd D:\libevent_project\libevent-2.1.8-stable
nmake /f Makefile.nmake clean
nmake /f Makefile.nmake OPENSSL_DIR=D:\libevent_project\build_project_vs2019_64\openssl
md %OUT%\lib
md %OUT%\bin
md %OUT%\include
copy /Y *.lib %OUT%\lib
xcopy /S/Y include %OUT%\include\
xcopy /S/Y WIN32-Code\nmake %OUT%\include\
copy /Y *.dll %OUT%\bin
copy /Y *.exe %OUT%\bin
@echo "==========end build libevent============"
pause

在这里插入图片描述



这篇关于libevent 编译与安装二 (WIN10 visual studio2019, ubuntu) x64的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程