日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > c/c++ >内容正文

c/c++

vcpkg工具+vs2019

發布時間:2023/12/31 c/c++ 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 vcpkg工具+vs2019 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

好處

自動處理庫依賴, 不需額外配置庫 include路徑 和庫 lib路徑

Applied user-wide integration for this vcpkg root.All MSBuild C++ projects can now #include any installed libraries. Linking will be handled automatically. Installing new libraries will make them instantly available.CMake projects should use: "-DCMAKE_TOOLCHAIN_FILE=F:/GIT/vcpkg/scripts/buildsystems/vcpkg.cmake"

安裝

git clone https://github.com/Microsoft/vcpkg.git cd vcpkg bootstrap-vcpkg.bat vcpkg integrate install//安裝jsoncpp 32位庫 可省略冒號后內容 vcpkg install jsoncpp 或vcpkg install jsoncpp:x86-windows //安裝jsoncpp detours位庫 vcpkg install detours:x64-windows //安裝//如果想在任意位置使用vcpkg 請把 vcpkg.exe 路徑加入PATH環境變量中

新建個工程看配置中出現vcpkg即成功

有些文件可能下載失敗
2022-2-21 23:58:33
這里我統一打包,放到對應 downloads目錄下,可能過期
https://download.csdn.net/download/u012787710/81785983

vc 源文件中引用即可,不需額外配置了

#include <iostream> #include <windows.h>#include <detours/detours.h> #include <json/json.h>void main() {DetourTransactionBegin();Json::Reader reader;Json::Value root;if (reader.parse("{\"code\":200}", root)) {printf("code:%d\n", root["code"].asInt());// 200}system("pause"); }

附錄相關命令參數

vcpkg --help Commands:vcpkg search [pat] Search for packages available to be builtvcpkg install <pkg>... Install a packagevcpkg remove <pkg>... Uninstall a packagevcpkg remove --outdated Uninstall all out-of-date packagesvcpkg list List installed packagesvcpkg update Display list of packages for updatingvcpkg upgrade Rebuild all outdated packagesvcpkg x-history <pkg> (Experimental) Shows the history of CONTROL versions of a packagevcpkg hash <file> [alg] Hash a file by specific algorithm, default SHA512vcpkg help topics Display the list of help topicsvcpkg help <topic> Display help for a specific topicvcpkg integrate install Make installed packages available user-wide. Requires adminprivileges on first usevcpkg integrate remove Remove user-wide integrationvcpkg integrate project Generate a referencing nuget package for individual VS project usevcpkg integrate powershell Enable PowerShell tab-completionvcpkg export <pkg>... [opt]... Exports a packagevcpkg edit <pkg> Open up a port for editing (uses %EDITOR%, default 'code')vcpkg create <pkg> <url> [archivename]Create a new packagevcpkg x-init-registry <path> Initializes a registry in the directory <path>vcpkg format-manifest --all Formats all vcpkg.json files. Run this before committing to vcpkg.vcpkg owns <pat> Search for files in installed packagesvcpkg depend-info <pkg>... Display a list of dependencies for packagesvcpkg env Creates a clean shell environment for development or compilingvcpkg version Display version informationvcpkg contact Display contact information to send feedbackOptions:--triplet=<t> Specify the target architecture triplet. See 'vcpkg help triplet'(default: %VCPKG_DEFAULT_TRIPLET%)--host-triplet=<t> Specify the host architecture triplet. See 'vcpkg help triplet'(default: %VCPKG_DEFAULT_HOST_TRIPLET%)--overlay-ports=<path> Specify directories to be used when searching for ports(also: %VCPKG_OVERLAY_PORTS%)--overlay-triplets=<path> Specify directories containing triplets files(also: %VCPKG_OVERLAY_TRIPLETS%)--binarysource=<path> Add sources for binary caching. See 'vcpkg help binarycaching'--x-asset-sources=<path> Add sources for asset caching. See 'vcpkg help assetcaching'--downloads-root=<path> Specify the downloads root directory(default: %VCPKG_DOWNLOADS%)--vcpkg-root=<path> Specify the vcpkg root directory(default: %VCPKG_ROOT%)--x-buildtrees-root=<path> (Experimental) Specify the buildtrees root directory--x-install-root=<path> (Experimental) Specify the install root directory--x-packages-root=<path> (Experimental) Specify the packages root directory--x-json (Experimental) Request JSON output@response_file Specify a response file to provide additional parametersFor more help (including examples) see the accompanying README.md and docs folder. vcpkg help triplet Available architecture triplets VCPKG built-in triplets:arm-uwparm64-windowsx64-linuxx64-osxx64-uwpx64-windows-staticx64-windowsx86-windowsVCPKG community triplets:arm-androidarm-iosarm-linuxarm-mingw-dynamicarm-mingw-staticarm-neon-androidarm-windows-staticarm-windowsarm64-androidarm64-iosarm64-linuxarm64-mingw-dynamicarm64-mingw-staticarm64-osx-dynamicarm64-osxarm64-uwparm64-windows-static-mdarm64-windows-staticarmv6-androidppc64le-linuxs390x-linuxwasm32-emscriptenx64-androidx64-freebsdx64-iosx64-linux-releasex64-mingw-dynamicx64-mingw-staticx64-openbsdx64-osx-dynamicx64-osx-releasex64-windows-releasex64-windows-static-mdx86-androidx86-freebsdx86-iosx86-mingw-dynamicx86-mingw-staticx86-uwpx86-windows-static-mdx86-windows-staticx86-windows-v120

總結

以上是生活随笔為你收集整理的vcpkg工具+vs2019的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。