由于众所周知的原因,在 windows 下进行 c++ 开发是一件极其痛苦的事情。我也多次因为无法在 windows 下配置开发环境而转向 linux 开发。我在最近移植我的 linux 应用时,发现了一个在 windows 下非常方便的 c++ 安装包管理器。这个就是 vcpkg。通过使用 vcpkg,可以在 windows 上实现 linux 一样的开发环境。
CMake projects should use: "-DCMAKE_TOOLCHAIN_FILE=C:/software/vcpkg-2024.01.12/scripts/buildsystems/vcpkg.cmake"
All MSBuild C++ projects can now #include any installed libraries. Linking will be handled automatically. Installing new libraries will make them instantly available.
PS C:\software\vcpkg-2024.01.12> .\vcpkg.exe install openssl warning: In the September 2023 release, the default triplet for vcpkg libraries changed from x86-windows to the detected host triplet (x64-windows). For the old behavior, add --triplet x86-windows . To suppress this message, add --triplet x64-windows . Computing installation plan... The following packages are already installed: openssl:x64-windows@3.2.0#2 openssl:x64-windows is already installed Total install time: 275 us The package openssl is compatible with built-in CMake targets: