Home > Net >  VCPKG package installation fails on wrong path with semicolon
VCPKG package installation fails on wrong path with semicolon

Time:12-30

I'm new to MSYS2, VCPKG and CMAKE. I want to build package MSDFGEN via MSYS2/UCRT64 and VCPKG on Windows. What I did so far:

  • Installed Visual Studio Community Edition Installed MSYS2 started UCRT64 console
  • Added paths C:\msys64\ucrt64\bin;C:\msys64\usr\bin;
  • Then in UCRT64 console:
 pacman -Syu
 pacman -Su
 pacman -S --needed base-devel mingw-w64-ucrt-x86_64-toolchain git cmake
 git clone https://github.com/Microsoft/vcpkg.git
 cd vcpkg
./bootstrap-vcpkg.bat -disableMetrics
./vcpkg.exe integrate install
./vcpkg.exe install msdfgen

Result:

Computing installation plan...
The following packages will be built and installed:
  * brotli[core]:x86-windows -> 1.0.9#4
  * bzip2[core,tool]:x86-windows -> 1.0.8#3
  * freetype[brotli,bzip2,core,png,zlib]:x86-windows -> 2.12.1#3
  * libpng[core]:x86-windows -> 1.6.39
    msdfgen[core]:x86-windows -> 1.9.2
  * vcpkg-cmake[core]:x64-windows -> 2022-10-30
  * vcpkg-cmake-config[core]:x64-windows -> 2022-02-06#1
  * zlib[core]:x86-windows -> 1.2.13
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x64-windows...
error: while detecting compiler information:
The log file content at "C:\msys64\home\myname\vcpkg\buildtrees\detect_compiler\stdout-x64-windows.log" is:
CMake Error at C:/msys64/home/myname/vcpkg/scripts/ports.cmake:110 (message):
  Cannot find port:

    Directory does not exist: C;/msys64/home/myname/vcpkg/scripts/detect_compiler

error: vcpkg was unable to detect the active compiler's information. See above for the CMake failure output. 

Directory detect_compiler exists, but notice that path includes semicolon. How do I fix this?

CodePudding user response:

Most likely the issue is with some incorrectly set environment variable in your system (or any other CMake variable) to debug this issue I would start by figuring out if you can find the variable responsible (maybe it's the PATH) variable. To debug this, try running this command in powershell:

dir env: | out-string -stream | Select-String -Pattern "C;/msys64" 

Or just:

dir env: | out-string -stream | Select-String -Pattern "C;"

After you figure out which variable it is, then you can set it properly.

EDIT: I've noticed that you aren't using the correct triplets (I've mentioned it in the comments, but here it may have better formatting): Try exporting these variables, so that you download the correct triplets when using mingw64:

export VCPKG_DEFAULT_TRIPLET=x64-mingw-dynamic
export VCPKG_DEFAULT_HOST_TRIPLET=x64-mingw-dynamic

As is mentioned here in this link

EDIT2: It may seem that the UCRT64 environment is not supported by VCPKG, hence I am not sure if the MinGW triplets will solve the issue (but you may try).

  • Related