【踩坑】Vcpkg报错

前言

Vcpkg在执行install时报错:error: Could not detect vcpkg-root. You must define the VCPKG_ROOT environment variable to point to a cloned copy of https://github.com/Microsoft/vcpkg.

原因

  • 在执行完brew install vcpkg后没有配置环境变量

解决问题

  • 根据自己的Vcpkg的安装目录,添加环境变量
~/.zshrc
1
2
3
# Setting PATH for Vcpkg
export VCPKG_ROOT="/opt/homebrew/Cellar/vcpkg/2022.10.17/"
export PATH=$PATH:$VCPKG_ROOT/bin:.

完成

参考文献

CSDN——进阶的Laven