VSCode编译Hello示例文件报错T_T这什么奇葩问题

allrobot
Posts: 17
Joined: Wed Nov 03, 2021 7:15 am

VSCode编译Hello示例文件报错T_T这什么奇葩问题

Postby allrobot » Wed Mar 09, 2022 4:59 am

按IDF文档步骤安装IDF,工具链安装完了,环境变量也导入了,然后打开示例文件的hello项目,接着输入"CMAKE:Select a Kit"命令,结果VSCode控制台报错:😢😢
Image

报错:

Code: Select all

[variant] Loaded new set of variants
[kit] Successfully loaded 6 kits from C:\Users\xxxx\AppData\Local\CMakeTools\cmake-tools-kits.json
[proc] Executing command: "C:\Program Files (x86)\mingw64\bin\x86_64-w64-mingw32-gcc.exe" -v
[main] Configuring folder: hello_world 
[proc] Executing command: C:\Users\xxxx\.espressif\tools\cmake\3.20.3\bin\cmake.EXE --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug "-DCMAKE_C_COMPILER:FILEPATH=C:\Program Files (x86)\mingw64\bin\x86_64-w64-mingw32-gcc.exe" "-DCMAKE_CXX_COMPILER:FILEPATH=C:\Program Files (x86)\mingw64\bin\x86_64-w64-mingw32-g++.exe" -Hc:/Users/xxxx/esp/test/hello_world -Bc:/Users/xxxx/esp/test/hello_world/build -G Ninja
[cmake] Not searching for unused variables given on the command line.
[cmake] -- Found Git: C:/Users/xxxx/.espressif/tools/idf-git/2.34.2/cmd/git.exe (found version "2.34.1.windows.1") 
[cmake] -- IDF_TARGET not set, using default target: esp32
[cmake] -- The C compiler identification is unknown
[cmake] -- The CXX compiler identification is unknown
[cmake] -- The ASM compiler identification is unknown
[cmake] -- Found assembler: C:/ProgramData/nodemcu-prebuilt-toolchains-master/esp32/bin/xtensa-esp32-elf-gcc
[cmake] -- Detecting C compiler ABI info
[cmake] -- Detecting C compiler ABI info - failed
[cmake] -- Check for working C compiler: C:/ProgramData/nodemcu-prebuilt-toolchains-master/esp32/bin/xtensa-esp32-elf-gcc
[cmake] -- Check for working C compiler: C:/ProgramData/nodemcu-prebuilt-toolchains-master/esp32/bin/xtensa-esp32-elf-gcc - broken
[cmake] CMake Error at C:/Users/xxxx/.espressif/tools/cmake/3.20.3/share/cmake-3.20/Modules/CMakeTestCCompiler.cmake:66 (message):
[cmake]   The C compiler
[cmake] 
[cmake]     "C:/ProgramData/nodemcu-prebuilt-toolchains-master/esp32/bin/xtensa-esp32-elf-gcc"
[cmake] 
[cmake]   is not able to compile a simple test program.
[cmake] 
[cmake]   It fails with the following output:
[cmake] 
[cmake]     Change Dir: C:/Users/xxxx/esp/test/hello_world/build/CMakeFiles/CMakeTmp
[cmake]     
[cmake]     Run Build Command(s):C:/Users/xxxx/.espressif/tools/ninja/1.10.2/ninja.exe cmTC_afe41 && 
[cmake]     CreateProcess failed. Command attempted:
[cmake]     "C:\ProgramData\nodemcu-prebuilt-toolchains-master\esp32\bin\xtensa-esp32-elf-gcc   -mlongcalls -Wno-frame-address -o CMakeFiles\cmTC_afe41.dir\testCCompiler.c.obj -c testCCompiler.c"
[cmake]     ninja: fatal: CreateProcess: %1 不是有效的 Win32 应用程序。
[cmake]     
[cmake]     
[cmake]     
[cmake] 
[cmake]   
[cmake] 
[cmake]   CMake will not be able to correctly generate this project.
[cmake] Call Stack (most recent call first):
[cmake]   C:/Users/xxxx/Desktop/esp-idf/tools/cmake/project.cmake:311 (__project)
[cmake]   CMakeLists.txt:6 (project)
[cmake] 
[cmake] 
[cmake] -- Configuring incomplete, errors occurred!
[cmake] See also "C:/Users/xxxx/esp/test/hello_world/build/CMakeFiles/CMakeOutput.log".
[cmake] See also "C:/Users/xxxx/esp/test/hello_world/build/CMakeFiles/CMakeError.log".
我使用CMD输入"idf.py set-target esp32"命令,报错如下:

Code: Select all

Active code page: 65001
Setting PYTHONNOUSERSITE, was not set
Using Python in C:\Users\xxxx\.espressif\python_env\idf4.4_py3.8_env\Scripts\
Python 3.8.7
Using Git in C:\Users\xxxx\.espressif\tools\idf-git\2.34.2\cmd\
git version 2.34.1.windows.1
Setting IDF_PATH: C:\Users\xxxx\.espressif\frameworks\esp-idf-v4.4

Adding ESP-IDF tools to PATH...
Not using an unsupported version of tool openocd-esp32 found in PATH: 0.11.0.
    C:\Users\xxxx\.espressif\tools\openocd-esp32\v0.11.0-esp32-20211220\openocd-esp32\bin

Checking if Python packages are up to date...
Python requirements from C:\Users\xxxx\.espressif\frameworks\esp-idf-v4.4\requirements.txt are satisfied.

Done! You can now compile ESP-IDF projects.
Go to the project directory and run:

  idf.py build

C:\Users\xxxx\esp\test\hello_world>idf.py set-target esp32
WARNING: IDF_PATH environment variable is set to c:\users\xxxx\esp\esp-idf-v4.4 but idf.py path indicates IDF directory c:\users\xxxx\.espressif\frameworks\esp-idf-v4.4. Using the environment variable directory, but results may be unexpected...
Adding "set-target"'s dependency "fullclean" to list of commands with default set of options.
Executing action: fullclean
Executing action: set-target
Set Target to: esp32, new sdkconfig created. Existing sdkconfig renamed to sdkconfig.old.
Running cmake in directory c:\users\xxxx\esp\test\hello_world\build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 -DIDF_TARGET=esp32 -DCCACHE_ENABLE=0 c:\users\xxxx\esp\test\hello_world"...
-- Found Git: C:/Users/xxxx/.espressif/tools/idf-git/2.34.2/cmd/git.exe (found version "2.34.1.windows.1")
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- The ASM compiler identification is unknown
-- Found assembler: C:/ProgramData/nodemcu-prebuilt-toolchains-master/esp32/bin/xtensa-esp32-elf-gcc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/ProgramData/nodemcu-prebuilt-toolchains-master/esp32/bin/xtensa-esp32-elf-gcc
-- Check for working C compiler: C:/ProgramData/nodemcu-prebuilt-toolchains-master/esp32/bin/xtensa-esp32-elf-gcc - broken
CMake Error at C:/Users/xxxx/.espressif/tools/cmake/3.20.3/share/cmake-3.20/Modules/CMakeTestCCompiler.cmake:66 (message):
  The C compiler

    "C:/ProgramData/nodemcu-prebuilt-toolchains-master/esp32/bin/xtensa-esp32-elf-gcc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: C:/Users/xxxx/esp/test/hello_world/build/CMakeFiles/CMakeTmp

    Run Build Command(s):C:/Users/xxxx/.espressif/tools/ninja/1.10.2/ninja.exe cmTC_1b439 &&
    CreateProcess failed. Command attempted:
    "C:\ProgramData\nodemcu-prebuilt-toolchains-master\esp32\bin\xtensa-esp32-elf-gcc   -mlongcalls -Wno-frame-address -o CMakeFiles\cmTC_1b439.dir\testCCompiler.c.obj -c testCCompiler.c"
    ninja: fatal: CreateProcess: %1 ������Ч�� Win32 Ӧ�ó���






  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  C:/Users/xxxx/esp/esp-idf-v4.4/tools/cmake/project.cmake:290 (__project)
  CMakeLists.txt:6 (project)


-- Configuring incomplete, errors occurred!
See also "C:/Users/xxxx/esp/test/hello_world/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/xxxx/esp/test/hello_world/build/CMakeFiles/CMakeError.log".
cmake failed with exit code 1

C:\Users\xxxx\esp\test\hello_world>

报错文件:
https://github.com/jmattsson/nodemcu-pr ... eError.log
https://github.com/jmattsson/nodemcu-pr ... Output.log


我无法理解错误是如何发生的,似乎是nodemcu-prebuilt-toolchains-master的问题?

Image


Who is online

Users browsing this forum: No registered users and 85 guests