vcpkg在vs/vscode下用法

vs下不使用cmake,单纯依靠vs和vcpkg

首先在windows cmd中执行下面的代码,安装vcpkg

bash 复制代码
git clone https://github.com/microsoft/vcpkg.git
bash 复制代码
cd vcpkg && bootstrap-vcpkg.bat

官网说下面这个代码可以与 Visual Studio MSBuild 集成,实测无效

bash 复制代码
.\vcpkg.exe integrate install

所以我们还是选择在cmd中下载包,并在编译器中设置包含目录和库目录实现第三方库的引用

以opencv为例

下载

bash 复制代码
./vcpkg install opencv

vs设置

包含目录新增 自己的目录\vcpkg\installed\x64-windows\include\opencv

库目录新增 自己的目录vcpkg\installed\x64-windows\lib

完成上述操作后就可以在第三方库中使用opencv了。

相关推荐
布鲁飞丝16 小时前
从零实现富文本编辑器#-浏览器选区与编辑器选区模型同步
java·前端·编辑器
计算机内卷的N天16 小时前
CMake与Visual Studio的使用
c++·ide·visual studio
咱入行浅17 小时前
一款实用的 Visual Studio 发布部署插件,助力提高部署效率!
ide·visual studio
谢斯17 小时前
[vscode] 使用unity打开vscode的取消.csproj的显示
ide·vscode·unity
2501_916007471 天前
SwiftUI 声明式语法与 Xcode 预览功能详解
ide·vscode·ios·swiftui·个人开发·xcode·敏捷流程
呐抹倾1 天前
【译】Visual Studio 停用:针对旧版本 Visual Studio 的支持提醒
ide·visual studio
爱就是恒久忍耐2 天前
使用VSCode开发STM32 (通用版本)
ide·vscode·stm32
FlightYe2 天前
音视频修炼之视频基础(一):视频基础理论
android·c++·vscode·音视频·androidx·android runtime
我要见SA姐12 天前
VsCode 使用指南(配置 + 美化)
ide·vscode·编辑器
魔尔助理顾问2 天前
安装 Jupyter Notebook (推荐给 venv 用户)
开发语言·ide·python·jupyter