vcpkg工具+vs2019
生活随笔
收集整理的這篇文章主要介紹了
vcpkg工具+vs2019
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
好處
自動處理庫依賴, 不需額外配置庫 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位庫 可省略冒號后內(nèi)容 vcpkg install jsoncpp 或vcpkg install jsoncpp:x86-windows //安裝jsoncpp detours位庫 vcpkg install detours:x64-windows //安裝//如果想在任意位置使用vcpkg 請把 vcpkg.exe 路徑加入PATH環(huán)境變量中新建個工程看配置中出現(xiàn)vcpkg即成功
有些文件可能下載失敗
2022-2-21 23:58:33
這里我統(tǒng)一打包,放到對應(yīng) 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"); }附錄相關(guān)命令參數(shù)
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總結(jié)
以上是生活随笔為你收集整理的vcpkg工具+vs2019的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: visual svn server安装失
- 下一篇: Ubuntu 搭建SVN服务器(SVN