CMakeOutput CmakeError problem building code using VS code

zazas321
Posts: 231
Joined: Mon Feb 01, 2021 9:41 am

CMakeOutput CmakeError problem building code using VS code

Postby zazas321 » Thu Apr 22, 2021 7:58 am

Hello. I have decided to set up ESP-IDF for programming ESP32 devices. I have been using Arduino IDE for a long time now I want to experiment with ESP-IDF. I have found this tutorial : https://www.youtube.com/watch?v=Lc6ausi ... sifSystems
And followed it. Installed git, Python and followed the ESP-IDF installation process as well as all the installations for the esp-idf. I have started the example hello world project but cannot build it. Seems like many people have this issue but I am not able to find a clear solution to this problem, perhaps you guys can help :

Full error code:

Code: Select all

> Executing task: cmake -G Ninja .. <

-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.31.1.windows.1") 
-- The C compiler identification is GNU 8.4.0
-- The CXX compiler identification is GNU 8.4.0
-- The ASM compiler identification is GNU
-- Found assembler: C:/Users/Lukas/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe
-- Check for working C compiler: C:/Users/Lukas/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe
CMake Error at C:/Users/Lukas/.espressif/tools/cmake/3.16.4/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:44 (try_compile):
  Failed to open

    C:/Users/Lukas/Desktop/Programming/ESP-IDF/test_programs/hello_world/build/CMakeFiles/CMakeTmp/CMakeLists.txt

  Permission denied
Call Stack (most recent call first):
  C:/Users/Lukas/Desktop/Programming/ESP-IDF/esp-idf/tools/cmake/project.cmake:307 (__project)
  CMakeLists.txt:6 (project)


-- Check for working C compiler: C:/Users/Lukas/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe -- broken
CMake Error at C:/Users/Lukas/.espressif/tools/cmake/3.16.4/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:60 (message):
  The C compiler

    "C:/Users/Lukas/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe"

  is not able to compile a simple test program.

  It fails with the following output:





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  C:/Users/Lukas/Desktop/Programming/ESP-IDF/esp-idf/tools/cmake/project.cmake:307 (__project)
  CMakeLists.txt:6 (project)


-- Configuring incomplete, errors occurred!


See also "C:/Users/Lukas/Desktop/Programming/ESP-IDF/test_programs/hello_world/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Lukas/Desktop/Programming/ESP-IDF/test_programs/hello_world/build/CMakeFiles/CMakeError.log".
The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command cmake -G Ninja .." terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.


ESP_bignacio
Posts: 229
Joined: Wed May 02, 2018 12:12 pm

Re: CMakeOutput CmakeError problem building code using VS code

Postby ESP_bignacio » Sun Apr 25, 2021 9:02 am

Apparently your extension is not configured properly since the build can't find the toolchain.

Please review https://github.com/espressif/vscode-esp ... install.md

zazas321
Posts: 231
Joined: Mon Feb 01, 2021 9:41 am

Re: CMakeOutput CmakeError problem building code using VS code

Postby zazas321 » Mon Apr 26, 2021 5:45 am

I have reinstalled python and now trying to follow esp-idf installation procedure once again as described in the link you have provided. After the esp-idf installation process, I can see some errors about the python :

Code: Select all

Installing ESP-IDF extension python packages in C:\Users\Lukas\.espressif\python_env\idf4.2_py3.9_env\Scripts\python.exe ...


No Python at 'C:\Users\Lukas\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe'
Command failed: "C:\Users\Lukas\.espressif\python_env\idf4.2_py3.9_env\Scripts\python.exe" -m pip install --no-warn-script-location  -r "c:\Users\Lukas\.vscode\extensions\espressif.esp-idf-extension-1.0.2\requirements.txt"
No Python at 'C:\Users\Lukas\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe'
Command failed: "C:\Users\Lukas\.espressif\python_env\idf4.2_py3.9_env\Scripts\python.exe" -m pip install --no-warn-script-location  -r "c:\Users\Lukas\.vscode\extensions\espressif.esp-idf-extension-1.0.2\requirements.txt"
No Python at 'C:\Users\Lukas\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe'
I do not understand what this error means.

From the error code, It seems like it is looking for my python in

Code: Select all

'C:\Users\Lukas\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation 
However, thats not where my python is installed. I have installed my python in

Code: Select all

c:\Users\Lukas\AppData\Local\Programs\Python\Python39\python.exe
And this is the location that is provided in the esp-idf installation

Perhaps someone can clarify to me what would be the issue here?

Who is online

Users browsing this forum: No registered users and 31 guests