{"id":5210,"date":"2021-05-08T10:02:08","date_gmt":"2021-05-08T02:02:08","guid":{"rendered":"https:\/\/damogame.cn\/wordpress\/?p=5210"},"modified":"2021-05-08T10:02:08","modified_gmt":"2021-05-08T02:02:08","slug":"libtorrent-windows%e6%90%ad%e5%bb%ba-libtorrent-%e5%bc%80%e5%8f%91%e7%8e%af%e5%a2%83","status":"publish","type":"post","link":"https:\/\/i007.cc\/wordpress\/archives\/5210","title":{"rendered":"[libtorrent] windows\u642d\u5efa libtorrent \u5f00\u53d1\u73af\u5883"},"content":{"rendered":"<p><a href=\"https:\/\/blog.csdn.net\/dangwei_90\/article\/details\/111316568\">\u539f\u6587\u5730\u5740<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>\u6c60\u5858\u7801\u519c 2020-12-17 15:54:26 156 \u6536\u85cf 1<br \/>\n\u5206\u7c7b\u4e13\u680f\uff1a libtorrent \u6587\u7ae0\u6807\u7b7e\uff1a windows libtorrent \u642d\u5efa \u73af\u5883 \u5f00\u53d1<br \/>\n\u7248\u6743<br \/>\n\u64cd\u4f5c\u7cfb\u7edf\uff1awin10<br \/>\n\u5f00\u53d1\u5de5\u5177\uff1aVS2019<\/p>\n<p>(\u53c2\u8003\u6587\u6863\uff1alibtorrent)<\/p>\n<p>\u642d\u5efa libtorrent \u6b65\u9aa4\uff1a<br \/>\n\u4e00. \u5b89\u88c5 vcpkg \u548c boost<\/p>\n<p>1.\u00a0\u5b89\u88c5 vcpkg \u5230\u672c\u5730<br \/>\ngit clone https:\/\/github.com\/microsoft\/vcpkg<\/p>\n<p>2.\u00a0\u6267\u884c\u00a0bootstrap-vcpkg.bat \u811a\u672c<br \/>\n.\\vcpkg\\bootstrap-vcpkg.bat<\/p>\n<p>3.\u00a0\u6dfb\u52a0vcpkg\u73af\u5883\u53d8\u91cf<br \/>\n\u73af\u5883\u53d8\u91cf-&gt;PTAH-&gt;\u6dfb\u52a0 vcpkg \u7684\u76ee\u5f55\uff0c\u5982\u4e0b\u56fe\uff1a<br \/>\n4. \u5b89\u88c5 boost<br \/>\n.\\vcpkg.exe install boost:x86-windows<br \/>\n(\u6ce8\uff1a\u6b64\u5904\u6ce8\u610f\uff0c\u5b89\u88c5\u9700\u8981\u4e00\u4e9b\u65f6\u95f4\uff0c\u6ce8\u610f\u53ef\u80fd\u4f1a\u56e0\u4e3a\u7f3a\u5c11 VS\u82f1\u6587\u5305 \u62a5\u9519)<\/p>\n<p>5. \u5b89\u88c5 OpenSSL<br \/>\n(\u5982\u679c\u672c\u5730\u6ca1\u6709\u5b89\u88c5 SSL\uff0c\u90a3\u4e48\u9700\u8981\u8fdb\u884c\u6b64\u6b65\u9aa4)<br \/>\n\u4f20\u9001\u95e8\uff1ahttp:\/\/slproweb.com\/products\/Win32OpenSSL.html\u00a0(\u4e0b\u8f7d 32\u4f4d \u7248\u672c)<br \/>\n\u5b89\u88c5\u6210\u529f\u540e\uff0c\u914d\u7f6e\u73af\u5883\u53d8\u91cf\uff1a<br \/>\n\u73af\u5883\u53d8\u91cf-&gt;PTAH-&gt;\u6dfb\u52a0 vcpkg \u7684\u76ee\u5f55\uff0c\u5982\u4e0b\u56fe\uff1a<br \/>\n\u4e8c. \u7f16\u8bd1 libtorrent<\/p>\n<p>1. \u4e0b\u8f7d libtorrent \u6e90\u7801<br \/>\ngit\u00a0clone\u00a0\u00a0https:\/\/github.com\/arvidn\/libtorrent.git<\/p>\n<p>2. git init<br \/>\ngit submodule update &#8211;init<\/p>\n<p>3. \u4fee\u6539 CMakeLists.txt<br \/>\n\u6dfb\u52a0\u4e0b\u8fb9\u4e24\u884c\u5230 CMakeLists.txt \u4e2d<\/p>\n<p>set(VCPKG_ROOT &#8220;D:\/work\/libtorrent\/vcpkg\/scripts\/buildsystems\/vcpkg.cmake&#8221; CACHE PATH &#8220;&#8221;)<br \/>\nset(CMAKE_TOOLCHAIN_FILE ${VCPKG_ROOT})<br \/>\n\u4f4d\u7f6e\u5982\u56fe\u6240\u793a\uff1a<br \/>\n\u4e09. \u901a\u8fc7 cmake-gui \u751f\u6210 vs \u9879\u76ee<\/p>\n<p>1. \u4e0b\u8f7d\u5b89\u88c5 cmake-gui<br \/>\n\u4f20\u9001\u95e8\uff1aDownload | CMake<br \/>\n2. \u914d\u7f6e libcorrent<br \/>\n\u6253\u5f00 cmake-gui ,\u8bbe\u7f6e\u6e90\u7801\u8def\u5f84\u548c\u751f\u6210\u8def\u5f84<br \/>\n\u70b9\u51fb configure \u540e\uff0c\u9009 win32 , \u81ea\u52a8\u751f\u6210\u914d\u7f6e\uff0c\u5982\u4e0b\u56fe\u6240\u793a<br \/>\n\u914d\u7f6e\u751f\u6210\u6210\u529f\u540e\uff0c\u52fe\u9009 build_tests \u548c build_examples, \u70b9\u51fb Generate\uff0c\u751f\u6210\u914d\u7f6e\u6587\u4ef6\uff1b\u5982\u4e0b\u56fe\u6240\u793a<br \/>\n\u56db. \u7f16\u8bd1 libtorrent<\/p>\n<p>1. \u6253\u5f00VS2019 \uff0c\u52a0\u8f7d .\\libtorrent\\build\\ \u8def\u5f84\u4e0b\u7684\u00a0libtorrent.sln, \u5982\u4e0b\u56fe\u6240\u793a\uff1a<br \/>\n2. \u53f3\u952e ALL_BUILD ,\u5168\u90e8\u7f16\u8bd1\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a<br \/>\n\u5927\u529f\u544a\u6210\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u539f\u6587\u5730\u5740 &nbsp; \u6c60\u5858\u7801\u519c 202<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[],"tags":[119],"class_list":["post-5210","post","type-post","status-publish","format-standard","hentry","tag-03-"],"_links":{"self":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/5210","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/comments?post=5210"}],"version-history":[{"count":0,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/5210\/revisions"}],"wp:attachment":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/media?parent=5210"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/categories?post=5210"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/tags?post=5210"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}