【问题标题】:CMAKE_CXX_COMPILER <full path> is not a full path - when it actually isCMAKE_CXX_COMPILER <full path> 不是完整路径 - 实际上是
【发布时间】:2022-12-14 06:20:15
【问题描述】:

我使用来自 Microsoft VSCode 扩展“CMake 工具”的 CMake 时出现此错误

[cmake]   The CMAKE_CXX_COMPILER:
[cmake] 
[cmake]     C:/msys64/mingw64/bin/g++.exe
[cmake] 
[cmake]   is not a full path and was not found in the PATH.

但它确实是包含所有二进制文件的路径(我已经仔细检查过)!我使用“CMake:选择一个套件”下拉菜单选择它(F1 - > CMake:选择一个套件)

我的机器上同时安装了 MinGW 和 Cygwin。它也不适用于 Cygwin:

[cmake]   The CMAKE_CXX_COMPILER:
[cmake] 
[cmake]     C:/cygwin64/bin/x86_64-w64-mingw32-g++.exe
[cmake] 
[cmake]   is not a full path and was not found in the PATH.

您可以看到这两条路径实际上都是完整路径,但它们以某种方式不被 cmake 接受...

我的一个想法是,如果通过所述扩展使用,我不知道在什么环境下实际执行 cmake。如果它使用与我生成新终端时相同的默认终端,这将默认为可以解释问题的 Cygwin 终端。不过cmake也发现:

[proc] Executing command: C:/cygwin64/bin/cmake.exe --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=C:\cygwin64\bin\x86_64-w64-mingw32-gcc.exe -DCMAKE_CXX_COMPILER:FILEPATH=C:\cygwin64\bin\x86_64-w64-mingw32-g++.exe -Sc:/dev/supabase-cpp -Bc:/dev/supabase-cpp/build -G "Unix Makefiles" 

所以这几乎不是问题所在。

【问题讨论】:

    标签: cmake configuration


    【解决方案1】:

    我在 VSC 中使用 CMake Tools 扩展时遇到同样的问题,但我只使用 cygwin64。

    [cmake]   The CMAKE_C_COMPILER:
    [cmake] 
    [cmake]     C:/cygwin64/bin/gcc.exe
    [cmake] 
    [cmake]   is not a full path and was not found in the PATH.
    

    如果您找到解决方案,请发布。如果我设法自己解决这个问题,我也会这样做。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-05-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-15
      • 2017-11-08
      相关资源
      最近更新 更多