Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install any library #42210

Closed
DonShmily opened this issue Nov 18, 2024 · 3 comments
Closed

Cannot install any library #42210

DonShmily opened this issue Nov 18, 2024 · 3 comments

Comments

@DonShmily
Copy link

DonShmily commented Nov 18, 2024

Describe the bug
When I try to install a library, it always fails and displays the following message:

vcpkg install fmt
Computing installation plan...
The following packages will be built and installed:
    fmt:[email protected]#1
  * vcpkg-cmake:x64-windows@2024-04-23
  * vcpkg-cmake-config:x64-windows@2024-05-23
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x64-windows...
-- Automatically setting %HTTP(S)_PROXY% environment variables to "127.0.0.1:7890".
error: while detecting compiler information:
The log file content at "D:\Programing\vcpkg\buildtrees\detect_compiler\stdout-x64-windows.log" is:
CMake Error at D:/Programing/vcpkg/scripts/ports.cmake:139 (message):
  Cannot find port:

    Directory does not exist: D;/Programing/vcpkg/scripts/detect_compiler


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

Environment

  • Windows11
  • Compiler: MSVC

To Reproduce
Steps to reproduce the behavior:

  1. install vcpkg and add to enviroment variables
  2. vcpkg install
  3. error occured

Failure logs

CMake Error at D:/Programing/Microsoft Visual Studio/2022/Community/VC/vcpkg/scripts/ports.cmake:139 (message):
  Cannot find port:

    Directory does not exist: D;/Programing/Microsoft Visual Studio/2022/Community/VC/vcpkg/scripts/detect_compiler

Additional context
In the "vcpkg\scripts\ports.cmake" line 139

if(NOT EXISTS "${CURRENT_PORT_DIR}")
        message(FATAL_ERROR "Cannot find port: ${PORT}\n  Directory does not exist: ${CURRENT_PORT_DIR}")
    endif()
@DonShmily
Copy link
Author

btw, when I used command: .\vcpkg.exe integrate install, it shows:

Applied user-wide integration for this vcpkg root.
CMake projects should use: "-DCMAKE_TOOLCHAIN_FILE=D:/Programing/vcpkg/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.

@dg0yt
Copy link
Contributor

dg0yt commented Nov 18, 2024

    Directory does not exist: D;/Programing/Microsoft Visual Studio/2022/Community/VC/vcpkg/scripts/detect_compiler

This is the result of having an up-to-date CMake for the wrong system (MSYS or Cygwin).
Remove it from PATH, if not completely.

@DonShmily
Copy link
Author

    Directory does not exist: D;/Programing/Microsoft Visual Studio/2022/Community/VC/vcpkg/scripts/detect_compiler

This is the result of having an up-to-date CMake for the wrong system (MSYS or Cygwin).这是因为使用了错误的系统(Mackle或Cygwin)的最新CMake。 Remove it from PATH, if not completely.从PATH中删除它,如果不完全。

Thanks a lot, I recheck my PATH, and find a CMake from a toolkit I installed recently. Now it woks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants