For C++ cross-platform development, you can use the WSL(Windows Subsystem for Linux).
Windows Subsystem for Linux (WSL) lets developers run a GNU/Linux environment -- including most command-line tools, utilities, and applications -- directly on Windows, unmodified, without the overhead of a traditional virtual machine or dual-boot setup.
Four steps for setting up a WSL development environment:
In order to compile your c++ code on WSL/Linux, you need to install the libraries you depend on firstly on WSL/Linux. You can also use vcpkg on WSL to manage your c++ packages, but you should install the vcpkg on WSL/Linux firstly, not the vcpkg on Windows that you used now. So you can install vcpkg on WSL/Linux firstly, then use the vcpkg to install libraries you depend on. In order to let CMake to find the libraries from vcpkg, refer to CMake Integration.
And you must learn to use CMake to organize your project. Here is a step-by-step guide for using CMake.