簡體   English   中英

cmake mingw-w64:嘗試構建時出現奇怪錯誤

[英]cmake mingw-w64: strange error when trying to build

我已經安裝了 MinGW-w64 並構建了一個簡單的 Hello World 程序。 但我第二次運行cmake --build. 發生了一個奇怪的錯誤。 當 Path 變量設置為C:/MinGW/bin時,一切正常且工作正常。 但是當我將路徑設置為C:/msys64/mingw64/bin時,會發生這種情況:

PS C:\repos\hellovs\build> cmake ../ -G Ninja
-- The CXX compiler identification is GNU 10.1.0
-- Check for working CXX compiler: C:/msys64/mingw64/bin/c++.exe
-- Check for working CXX compiler: C:/msys64/mingw64/bin/c++.exe - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/repos/hellovs/build
PS C:\repos\hellovs\build> cmake --build ./
[2/2] Linking CXX executable HelloVS.exe
PS C:\repos\hellovs\build> cmake --build ./
ninja: error: FindFirstFileExA(c/:/msys64/mingw64/include/c++/10.1.0): ╤шэЄръёшўхёър  ю°шсър т шьхэш Їрщыр, шьхэш яряъш шыш ьхЄъх Єюьр.

HelloVS.exe在第一次運行構建命令時正常編譯。

Apparanteley Ninja 嘗試使用無效路徑。 關於如何解決這個問題的任何想法?


似乎已經生成了無效的依賴項:

PS C:\repos\hellovs\build> ninja -t recompact
PS C:\repos\hellovs\build> ninja -t deps
CMakeFiles/HelloVS.dir/main.cpp.obj: #deps 136, deps mtime 6109023486207704 (VALID)
    ../main.cpp
    C/:/msys64/mingw64/include/c++/10.1.0/iostream
    C/:/msys64/mingw64/include/c++/10.1.0/x86_64-w64-mingw32/bits/c++config.h
    C/:/msys64/mingw64/include/c++/10.1.0/x86_64-w64-mingw32/bits/os_defines.h
    C/:/msys64/mingw64/include/c++/10.1.0/x86_64-w64-mingw32/bits/cpu_defines.h
    C/:/msys64/mingw64/include/c++/10.1.0/pstl/pstl_config.h
    C/:/msys64/mingw64/include/c++/10.1.0/ostream
...

這是一個 GCC 錯誤。

MSYS2 維護人員決定不等待上游並對其進行修補

從 MSYS2 shell 運行pacman -Syuu來更新你的包。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM