paoloach / ESP32

ESP32 plugin for CLION
31 stars 4 forks source link

The CMAKE_C_COMPILER: xtensa-esp32-elf-gcc is not a full path and was not found in the PATH. #11

Open maxd opened 4 years ago

maxd commented 4 years ago

A just created ESP32 C project show the following errors in CMake tab:

...
-- Found Git: /usr/bin/git (found version "2.17.2 (Apple Git-113)") 
-- IDF_TARGET not set, using default target: esp32
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- The ASM compiler identification is unknown
-- Found assembler: xtensa-esp32-elf-gcc
CMake Error at /Users/xxx/.esp-idf/tools/cmake/project.cmake:308 (__project):
  The CMAKE_C_COMPILER:

    xtensa-esp32-elf-gcc

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.
Call Stack (most recent call first):
  CMakeLists.txt:7 (project)

CMake Error at /Users/xxx/.esp-idf/tools/cmake/project.cmake:308 (__project):
  The CMAKE_CXX_COMPILER:

    xtensa-esp32-elf-g++

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.
Call Stack (most recent call first):
  CMakeLists.txt:7 (project)

CMake Error at /Users/xxx/.esp-idf/tools/cmake/project.cmake:308 (__project):
  The CMAKE_ASM_COMPILER:

    xtensa-esp32-elf-gcc

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "ASM" or the CMake cache entry CMAKE_ASM_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.
Call Stack (most recent call first):
  CMakeLists.txt:7 (project)

-- Warning: Did not find file Compiler/-ASM
-- Configuring incomplete, errors occurred!
...

The Crosscompiler Path is specified on ESP32 config settings tab as /Users/xxx/.espressif/tools/xtensa-esp32-elf/esp-2020r2-8.2.0/xtensa-esp32-elf/bin (it has xtensia-esp32-elf-gcc file inside of). So, looks like ESP32 plugin don't pass this path to CMake correctly.

fragsalat commented 3 years ago

For me the issue was solved by removing the environment variables the plugin set's on cmake config in the settings and calling export.bat in the esp-idf folder.

ndming commented 1 year ago

Hi, I'm now facing this issue, have u found the solution to this problem?