windows 安装libtorrent C++库时出现“无法打开输入文件”libcrypto.lib“”

wj8zmpe1  于 2022-12-24  发布在  Windows
关注(0)|答案(1)|浏览(773)

I am attempting to install the libtorrent C++ library (cloned from GitHub repository) on Windows 11 with OpenSSL 1.1.1i installed and Visual Studio 2022.
Invoking b2 in my libtorrent source folder is returning the error LINK : fatal error LNK1181: cannot open input file 'libcrypto.lib' .
The file libcrypto.lib definitely exists in C:\Users\Me\openssl and C:\Users\Me\openssl is in my PATH. Installation was running fine until this point.
My steps were:

$ set LIB="C:\Users\Me\openssl";%LIB%
$ set INCLUDE="C:\Users\Me\openssl\include";%INCLUDE%
$ set BOOST_ROOT=c:\boost_1_80_0
$ set BOOST_BUILD_PATH=%BOOST_ROOT%\tools\build
$ cd "C:\Users\Me\libtorrent"
$ b2

The last step returns:
...updating 3 targets... msvc.link.dll bin\msvc-14.3\debug\cxxstd-14-iso\threading-multi\torrent-rasterbar.dll LINK : fatal error LNK1181: cannot open input file 'libcrypto.lib'
call "bin\standalone\msvc\msvc-14.3\msvc-setup.bat" >nul link /NOLOGO /INCREMENTAL:NO @"bin\msvc-14.3\debug\cxxstd-14-iso\threading-multi\torrent-rasterbar.dll.rsp" ...failed msvc.link.dll bin\msvc-14.3\debug\cxxstd-14-iso\threading-multi\torrent-rasterbar.dll bin\msvc-14.3\debug\cxxstd-14-iso\threading-multi\torrent.lib bin\msvc-14.3\debug\cxxstd-14-iso\threading-multi\torrent-rasterbar.pdb... ...removing bin\msvc-14.3\debug\cxxstd-14-iso\threading-multi\torrent-rasterbar.pdb ...failed updating 3 targets...
Edit: Fixed a typo

fv2wmkja

fv2wmkja1#

通过将libcrypto.lib复制到user-config.jam中指定的LIB路径解决。

相关问题