PICO示例C/C++使用CMAKE构建问题 - 检测C编译器ABI信息 - 失败

发布于 2025-02-04 23:52:23 字数 4552 浏览 4 评论 0原文

我正在尝试使用Visual Studio Code 2022在Windows 11上构建RP PICO的示例。

我一直在关注“从Raspberry Pi Pico开始”文档,并在nmake 命令用于使用开发人员命令提示符构建示例。 似乎第一个障碍是“检测C编译器ABI信息 - 失败”,请参见下文以获取完整输出。我已经在互联网上进行了搜索,并堆叠了溢出,并尝试了各种各样的修复程序,但似乎没有任何帮助。

我尝试了: 将CL.EXE设置为管理员
运行开发人员命令提示为admin
重新安装VS代码和CMAKE
手动安装Windows SDK(因为它不是MSVC安装程序上的选项)
运行vsdevcmd.bat,它会因“遇到错误”而失败,但没有什么更有用的。我已经运行调试并输出到TXT文件,但我不知道我在看什么。

提前致谢。


Microsoft (R) Program Maintenance Utility Version 14.32.31329.0
Copyright (C) Microsoft Corporation.  All rights reserved.

[  0%] Built target bs2_default
[  0%] Built target bs2_default_padded_checksummed_asm
[  0%] Performing configure step for 'ELF2UF2Build'
-- The C compiler identification is MSVC 19.32.31329.0
-- The CXX compiler identification is MSVC 19.32.31329.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.23/Modules/CMakeTestCCompiler.cmake:69 (message):
  The C compiler

    "C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: C:/pico/Downloads/pico-examples/build/elf2uf2/CMakeFiles/CMakeTmp

    Run Build Command(s):nmake -f Makefile /nologo cmTC_add02\fast &&   "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.32.31326\bin\Hostx64\x64\nmake.exe"  -f CMakeFiles\cmTC_add02.dir\build.make /nologo -L                  CMakeFiles\cmTC_add02.dir\build
    Building C object CMakeFiles/cmTC_add02.dir/testCCompiler.c.obj
        "C:\Program Files\CMake\bin\cmake.exe" -E cmake_cl_compile_depends --dep-file=CMakeFiles\cmTC_add02.dir\testCCompiler.c.obj.d --working-dir=C:\pico\Downloads\pico-examples\build\elf2uf2\CMakeFiles\CMakeTmp --filter-prefix="Note: including file: " -- C:\PROGRA~2\MICROS~4\2022\BUILDT~1\VC\Tools\MSVC\1432~1.313\bin\Hostx64\x64\cl.exe @C:\Users\Dan\AppData\Local\Temp\nmE440.tmp
    testCCompiler.c
    Linking C executable cmTC_add02.exe
        "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_add02.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x86\mt.exe --manifests -- C:\PROGRA~2\MICROS~4\2022\BUILDT~1\VC\Tools\MSVC\1432~1.313\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\cmTC_add02.dir\objects1.rsp @C:\Users\Dan\AppData\Local\Temp\nmE49F.tmp
    LINK Pass 1: command "C:\PROGRA~2\MICROS~4\2022\BUILDT~1\VC\Tools\MSVC\1432~1.313\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\cmTC_add02.dir\objects1.rsp /out:cmTC_add02.exe /implib:cmTC_add02.lib /pdb:C:\pico\Downloads\pico-examples\build\elf2uf2\CMakeFiles\CMakeTmp\cmTC_add02.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\cmTC_add02.dir/intermediate.manifest CMakeFiles\cmTC_add02.dir/manifest.res" failed (exit code 1104) with the following output:
    LINK : fatal error LNK1104: cannot open file 'MSVCRTD.lib'
    NMAKE : fatal error U1077: '"C:\Program Files\CMake\bin\cmake.exe"' : return code '0xffffffff'
    Stop.
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.32.31326\bin\Hostx64\x64\nmake.exe"' : return code '0x2'
    Stop.





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)


-- Configuring incomplete, errors occurred!
See also "C:/pico/Downloads/pico-examples/build/elf2uf2/CMakeFiles/CMakeOutput.log".
See also "C:/pico/Downloads/pico-examples/build/elf2uf2/CMakeFiles/CMakeError.log".
NMAKE : fatal error U1077: 'echo' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.32.31326\bin\Hostx64\x64\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.32.31326\bin\Hostx64\x64\nmake.exe"' : return code '0x2'
Stop.

I'm trying to build the examples for RP pico using Visual Studio Code 2022 on windows 11.

I have been following the "Getting started with raspberry pi pico" document and have succeeded up to the point where the nmake command is used to build the examples using developer command prompt.
It seems the first hurdle is "Detecting C compiler ABI info - failed" please see below for full output. I have searched all over the internet and stack overflow and tried various peoples fixes but nothing seems to help.

I have tried:
Setting cl.exe as administrator
Running developer command prompt as admin
Reinstalling VS code and cmake
Manually installed windows sdk (as it's not an option on the MSVC installer)
Running VsDevCmd.bat which fails with "Encountered errors" but nothing more useful. I have run the debug and output to txt file but I don't know what I'm looking at.

Thanks in advance.


Microsoft (R) Program Maintenance Utility Version 14.32.31329.0
Copyright (C) Microsoft Corporation.  All rights reserved.

[  0%] Built target bs2_default
[  0%] Built target bs2_default_padded_checksummed_asm
[  0%] Performing configure step for 'ELF2UF2Build'
-- The C compiler identification is MSVC 19.32.31329.0
-- The CXX compiler identification is MSVC 19.32.31329.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.23/Modules/CMakeTestCCompiler.cmake:69 (message):
  The C compiler

    "C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: C:/pico/Downloads/pico-examples/build/elf2uf2/CMakeFiles/CMakeTmp

    Run Build Command(s):nmake -f Makefile /nologo cmTC_add02\fast &&   "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.32.31326\bin\Hostx64\x64\nmake.exe"  -f CMakeFiles\cmTC_add02.dir\build.make /nologo -L                  CMakeFiles\cmTC_add02.dir\build
    Building C object CMakeFiles/cmTC_add02.dir/testCCompiler.c.obj
        "C:\Program Files\CMake\bin\cmake.exe" -E cmake_cl_compile_depends --dep-file=CMakeFiles\cmTC_add02.dir\testCCompiler.c.obj.d --working-dir=C:\pico\Downloads\pico-examples\build\elf2uf2\CMakeFiles\CMakeTmp --filter-prefix="Note: including file: " -- C:\PROGRA~2\MICROS~4\2022\BUILDT~1\VC\Tools\MSVC\1432~1.313\bin\Hostx64\x64\cl.exe @C:\Users\Dan\AppData\Local\Temp\nmE440.tmp
    testCCompiler.c
    Linking C executable cmTC_add02.exe
        "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_add02.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x86\mt.exe --manifests -- C:\PROGRA~2\MICROS~4\2022\BUILDT~1\VC\Tools\MSVC\1432~1.313\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\cmTC_add02.dir\objects1.rsp @C:\Users\Dan\AppData\Local\Temp\nmE49F.tmp
    LINK Pass 1: command "C:\PROGRA~2\MICROS~4\2022\BUILDT~1\VC\Tools\MSVC\1432~1.313\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\cmTC_add02.dir\objects1.rsp /out:cmTC_add02.exe /implib:cmTC_add02.lib /pdb:C:\pico\Downloads\pico-examples\build\elf2uf2\CMakeFiles\CMakeTmp\cmTC_add02.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\cmTC_add02.dir/intermediate.manifest CMakeFiles\cmTC_add02.dir/manifest.res" failed (exit code 1104) with the following output:
    LINK : fatal error LNK1104: cannot open file 'MSVCRTD.lib'
    NMAKE : fatal error U1077: '"C:\Program Files\CMake\bin\cmake.exe"' : return code '0xffffffff'
    Stop.
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.32.31326\bin\Hostx64\x64\nmake.exe"' : return code '0x2'
    Stop.





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)


-- Configuring incomplete, errors occurred!
See also "C:/pico/Downloads/pico-examples/build/elf2uf2/CMakeFiles/CMakeOutput.log".
See also "C:/pico/Downloads/pico-examples/build/elf2uf2/CMakeFiles/CMakeError.log".
NMAKE : fatal error U1077: 'echo' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.32.31326\bin\Hostx64\x64\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.32.31326\bin\Hostx64\x64\nmake.exe"' : return code '0x2'
Stop.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

剑心龙吟 2025-02-11 23:52:24

我在忍者项目中遇到了一个非常相似的问题。

该汇编是用下一个BAT文件触发的(它不完整,只是生成Cmake Cache的一部分):

@echo off
SETLOCAL

set BUILD_TYPE=%~1
IF NOT "%BUILD_TYPE%"=="" GOTO BUILD_TYPE_OK
set BUILD_TYPE=Debug
:BUILD_TYPE_OK

set CMAKE_MAKE_PROGRAM=C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe
set C_COMPILER=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe
set CXX_COMPILER=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe

echo Build type: %BUILD_TYPE%
echo SBP_SBP_MSVC_QT64_DIR  = %SBP_SBP_MSVC_QT64_DIR%

set PATH_X64=%PATH%;%SBP_SBP_MSVC_QT64_DIR%
set PATH=%PATH_X64%
cmake -DCMAKE_BUILD_TYPE=%BUILD_TYPE% "-DCMAKE_MAKE_PROGRAM=%CMAKE_MAKE_PROGRAM%" "-DCMAKE_C_COMPILER=%C_COMPILER%" "-DCMAKE_CXX_COMPILER=%CXX_COMPILER%" -DPDB_DIR=../deploy-pdb/x64 -DCMAKE_INSTALL_PREFIX=../deploy/bin-x64 -G Ninja -S . -B ../build/x64
if %errorlevel% neq 0 exit /b %errorlevel%

echo Done.
ENDLOCAL

原始输出看起来像这样:

Build type: Debug
SBP_SBP_MSVC_QT64_DIR  = c:\Qt\5.15.2\msvc2019_64
-- The C compiler identification is MSVC 19.32.31332.0
-- The CXX compiler identification is MSVC 19.32.31332.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.24/Modules/CMakeTestCCompiler.cmake:69 (message):
  The C compiler

    "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: D:/Job/Code/Subpac/x1c1-multitool/build/x64/CMakeFiles/CMakeTmp

    Run Build Command(s):C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe cmTC_3975f && [1/2] Building C object CMakeFiles\cmTC_3975f.dir\testCCompiler.c.obj
    [2/2] Linking C executable cmTC_3975f.exe
    FAILED: cmTC_3975f.exe
    cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_3975f.dir --rc=rc --mt=CMAKE_MT-NOTFOUND --manifests  -- C:\PROGRA~1\MIB055~1\2022\COMMUN~1\VC\Tools\MSVC\1432~1.313\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_3975f.dir\testCCompiler.c.obj  /out:cmTC_3975f.exe /implib:cmTC_3975f.lib /pdb:cmTC_3975f.pdb /version:0.0 /machine:x64  /debug /INCREMENTAL /subsystem:console  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
    RC Pass 1: command "rc /fo CMakeFiles\cmTC_3975f.dir/manifest.res CMakeFiles\cmTC_3975f.dir/manifest.rc" failed (exit code 0) with the following output:
    The system cannot find the file specified
    ninja: build stopped: subcommand failed.





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)


-- Configuring incomplete, errors occurred!
See also "D:/Test/build/x64/CMakeFiles/CMakeOutput.log".
See also "D:/Test/build/x64/CMakeFiles/CMakeError.log".

[process exited with code 1 (0x00000001)]

当我将下一行添加到构建脚本:
调用“ C:\ Program Files \ Microsoft Visual Studio \ 2022 \ Community \ VC \ Auxiliary \ build \ Vcvarsall.bat” AMD64。在BAT文件的部分下方添加了此行:

@echo off
SETLOCAL

set BUILD_TYPE=%~1
IF NOT "%BUILD_TYPE%"=="" GOTO BUILD_TYPE_OK
set BUILD_TYPE=Debug
:BUILD_TYPE_OK

call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64

set CMAKE_MAKE_PROGRAM=C:/Program Files/Microsoft Visual Studio/2022....

现在的输出看起来像这样,当我添加命令以部署时,所有这些都可以正常工作:

**********************************************************************
** Visual Studio 2022 Developer Command Prompt v17.2.6
** Copyright (c) 2022 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
Build type: Debug
SBP_SBP_MSVC_QT64_DIR  = c:\Qt\5.15.2\msvc2019_64
-- The C compiler identification is MSVC 19.32.31332.0
-- The CXX compiler identification is MSVC 19.32.31332.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: D:/Test/build/x64
Done.

希望它将有助于用nmake解决您的问题。

I had a pretty similar issue in my project with Ninja.

The compilation is triggered with the next bat file (it's not full, just a part to generate CMake cache):

@echo off
SETLOCAL

set BUILD_TYPE=%~1
IF NOT "%BUILD_TYPE%"=="" GOTO BUILD_TYPE_OK
set BUILD_TYPE=Debug
:BUILD_TYPE_OK

set CMAKE_MAKE_PROGRAM=C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe
set C_COMPILER=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe
set CXX_COMPILER=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe

echo Build type: %BUILD_TYPE%
echo SBP_SBP_MSVC_QT64_DIR  = %SBP_SBP_MSVC_QT64_DIR%

set PATH_X64=%PATH%;%SBP_SBP_MSVC_QT64_DIR%
set PATH=%PATH_X64%
cmake -DCMAKE_BUILD_TYPE=%BUILD_TYPE% "-DCMAKE_MAKE_PROGRAM=%CMAKE_MAKE_PROGRAM%" "-DCMAKE_C_COMPILER=%C_COMPILER%" "-DCMAKE_CXX_COMPILER=%CXX_COMPILER%" -DPDB_DIR=../deploy-pdb/x64 -DCMAKE_INSTALL_PREFIX=../deploy/bin-x64 -G Ninja -S . -B ../build/x64
if %errorlevel% neq 0 exit /b %errorlevel%

echo Done.
ENDLOCAL

The original output looked like this:

Build type: Debug
SBP_SBP_MSVC_QT64_DIR  = c:\Qt\5.15.2\msvc2019_64
-- The C compiler identification is MSVC 19.32.31332.0
-- The CXX compiler identification is MSVC 19.32.31332.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.24/Modules/CMakeTestCCompiler.cmake:69 (message):
  The C compiler

    "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: D:/Job/Code/Subpac/x1c1-multitool/build/x64/CMakeFiles/CMakeTmp

    Run Build Command(s):C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe cmTC_3975f && [1/2] Building C object CMakeFiles\cmTC_3975f.dir\testCCompiler.c.obj
    [2/2] Linking C executable cmTC_3975f.exe
    FAILED: cmTC_3975f.exe
    cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_3975f.dir --rc=rc --mt=CMAKE_MT-NOTFOUND --manifests  -- C:\PROGRA~1\MIB055~1\2022\COMMUN~1\VC\Tools\MSVC\1432~1.313\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_3975f.dir\testCCompiler.c.obj  /out:cmTC_3975f.exe /implib:cmTC_3975f.lib /pdb:cmTC_3975f.pdb /version:0.0 /machine:x64  /debug /INCREMENTAL /subsystem:console  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
    RC Pass 1: command "rc /fo CMakeFiles\cmTC_3975f.dir/manifest.res CMakeFiles\cmTC_3975f.dir/manifest.rc" failed (exit code 0) with the following output:
    The system cannot find the file specified
    ninja: build stopped: subcommand failed.





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)


-- Configuring incomplete, errors occurred!
See also "D:/Test/build/x64/CMakeFiles/CMakeOutput.log".
See also "D:/Test/build/x64/CMakeFiles/CMakeError.log".

[process exited with code 1 (0x00000001)]

The issue was fixed when I added the next line to the build script:
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64. Below the part of the bat file with this line added:

@echo off
SETLOCAL

set BUILD_TYPE=%~1
IF NOT "%BUILD_TYPE%"=="" GOTO BUILD_TYPE_OK
set BUILD_TYPE=Debug
:BUILD_TYPE_OK

call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64

set CMAKE_MAKE_PROGRAM=C:/Program Files/Microsoft Visual Studio/2022....

Now the output looks like this, and when I add commands to deploy, all works fine:

**********************************************************************
** Visual Studio 2022 Developer Command Prompt v17.2.6
** Copyright (c) 2022 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
Build type: Debug
SBP_SBP_MSVC_QT64_DIR  = c:\Qt\5.15.2\msvc2019_64
-- The C compiler identification is MSVC 19.32.31332.0
-- The CXX compiler identification is MSVC 19.32.31332.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: D:/Test/build/x64
Done.

Hope it will help to solve your problem with nmake.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文