idf4.2报错找不到cc1

doushi_zch
Posts: 1
Joined: Sun Jan 10, 2021 4:22 pm

idf4.2报错找不到cc1

Postby doushi_zch » Sun Jan 10, 2021 4:37 pm

环境:ubuntu 20.04
esp-idf-v4.2(官网下载解压版本)
按照快速入门进行配置,到配置hellow world时,执行idf.py set-target esp32报错:
  1. zhangch@zch-vm-esp:~/esp/hello_world$ idf.py set-target esp32
  2. Adding "set-target"'s dependency "fullclean" to list of commands with default set of options.
  3. Executing action: fullclean
  4. Build directory '/home/zhangch/esp/hello_world/build' not found. Nothing to clean.
  5. Executing action: set-target
  6. Set Target to: esp32, new sdkconfig created. Existing sdkconfig renamed to sdkconfig.old.
  7. Running cmake in directory /home/zhangch/esp/hello_world/build
  8. Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 -DIDF_TARGET=esp32 -DCCACHE_ENABLE=0 /home/zhangch/esp/hello_world"...
  9. -- Found Git: /usr/bin/git (found version "2.25.1")
  10. -- The C compiler identification is unknown
  11. -- The CXX compiler identification is GNU 8.4.0
  12. -- The ASM compiler identification is GNU
  13. -- Found assembler: /home/zhangch/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
  14. -- Check for working C compiler: /home/zhangch/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
  15. -- Check for working C compiler: /home/zhangch/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc -- broken
  16. CMake Error at /usr/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:60 (message):
  17.  The C compiler
  18.  
  19.    "/home/zhangch/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc"
  20.  
  21.  is not able to compile a simple test program.
  22.  
  23.  It fails with the following output:
  24.  
  25.    Change Dir: /home/zhangch/esp/hello_world/build/CMakeFiles/CMakeTmp
  26.    
  27.    Run Build Command(s):/usr/bin/ninja cmTC_ffc4f && [1/2] Building C object CMakeFiles/cmTC_ffc4f.dir/testCCompiler.c.obj
  28.    FAILED: CMakeFiles/cmTC_ffc4f.dir/testCCompiler.c.obj
  29.    /home/zhangch/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc   -mlongcalls -Wno-frame-address -o CMakeFiles/cmTC_ffc4f.dir/testCCompiler.c.obj   -c testCCompiler.c
  30.    [color=#FF0000]xtensa-esp32-elf-gcc: error trying to exec 'cc1': execvp: No such file or directory[/color]
  31.    ninja: build stopped: subcommand failed.
  32.    
  33.    
  34.  
  35.  
  36.  
  37.  CMake will not be able to correctly generate this project.
  38. Call Stack (most recent call first):
  39.  /home/zhangch/esp/esp-idf-v4.2/tools/cmake/project.cmake:307 (__project)
  40.  CMakeLists.txt:6 (project)
  41.  
  42.  
  43. -- Configuring incomplete, errors occurred!
  44. See also "/home/zhangch/esp/hello_world/build/CMakeFiles/CMakeOutput.log".
  45. See also "/home/zhangch/esp/hello_world/build/CMakeFiles/CMakeError.log".
  46. cmake failed with exit code 1
  47. zhangch@zch-vm-esp:~/esp/hello_world$

ESP_morris
Posts: 290
Joined: Wed Sep 05, 2018 6:23 am

Re: idf4.2报错找不到cc1

Postby ESP_morris » Mon Jan 11, 2021 5:35 am

提示你的编译器有问题

The C compiler

"/home/zhangch/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc"

is not able to compile a simple test program.

可能是你安装的编译器坏了?

Who is online

Users browsing this forum: No registered users and 30 guests