[Solved] vcpkg Error: Error: Could not detect vcpkg-root.


When transferring vcpkg from CentOS 8 to CentOS virtual machine through SCP, the above error is always reported when running vcpkg

Root cause

The Linux environment needs to add the system variable $VCPKG_ROOT


vim ~/. bash_profile

Add a line:

export VCPKG_ROOT=”/home/devuser1/vcpkg”

Change the directory to your directory

Close the shell, reconnect, and everything is OK


[[email protected] vcpkg]# ./vcpkg list
abseil:x64-linux                                   2021-03-24#1     an open-source collection designed to augment th...
amqpcpp:x64-linux                                  4.3.11           AMQP-CPP is a C++ library for communicating with..

Read More: