9

设置vcpkg默认安装64位库

 2 years ago
source link: https://jasonkayzk.github.io/2022/05/05/%E8%AE%BE%E7%BD%AEvcpkg%E9%BB%98%E8%AE%A4%E5%AE%89%E8%A3%8564%E4%BD%8D%E5%BA%93/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

默认情况下,我们在win10下使用vcpkg安装的库都是x86的,对于x64的库,我们还需要手动指定参数;

但是在x64大行其道的现在,我们更希望能默认安装x64的库,此时只需要配置环境变量即可:

  • VCPKG_DEFAULT_TRIPLET=x64-windows

设置vcpkg默认安装64位库

默认情况下,我们需要在安装库的时候指定为x64,例如:

vcpkg install zlib:x64-windows
vcpkg install zlib --triplet x64-windows

我们可以通过配置环境变量来达到默认安装x64的效果:

VCPKG_DEFAULT_TRIPLET=x64-windows

对于Clion而言:

如果安装的是x86的库,而在CMake配置的是x64的编译器,则会找不到库;

Reference:


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK