Compiling example prject under windows attempts to use MSVC

espdorian
Posts: 33
Joined: Sat Dec 26, 2020 10:57 am

Compiling example prject under windows attempts to use MSVC

Postby espdorian » Sat Dec 26, 2020 11:04 am

I am new to ESP IDF, but using CMake already for quite some time for other projects.

I tries to build IDF example project from the windows IDF commadn prompt.

IDF path is correct
I can ask the compiler version.
However when executing CMake it always attempts to build with visual studio, which finally results in errors.
From the output below you can see the the assembler is detected correctly.

What am I overlooking ?

Code: Select all

cmake  -DVENDOR=espressif -DBOARD=esp32_wrover_kit -DCOMPILER=xtensa-esp32 -S . -B build ../

-- Building for: Visual Studio 12 2013
-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.21.0.windows.1")
-- IDF_TARGET not set, using default target: esp32
-- The C compiler identification is MSVC 18.0.31101.0
-- The CXX compiler identification is MSVC 18.0.31101.0
-- The ASM compiler identification is GNU
-- Found assembler: H:/.espressif/tools/xtensa-esp32-elf/esp-2020r2-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: Compiling example prject under windows attempts to use MSVC

Postby ESP_igrr » Sun Dec 27, 2020 12:12 am

Could you please try removing the build directory (to get rid of CMakeCache.txt), and then follow these instructions? https://docs.espressif.com/projects/esp ... e-directly.

If this still doesn't work (MSVC cl.exe is detected instead of xtensa compiler), please post the full CMake output you get, as well as your ESP-IDF version.

For troubleshooting purposes, it might be worth trying to build the project using "idf.py build" as described in the getting started guides. If that doesn't work, likely there is some installation issue. Again, full log output would help to figure out the cause.


(Note: the following options shouldn't be needed, if you are indeed compiling an ESP-IDF hello-world project: "-DVENDOR=espressif -DBOARD=esp32_wrover_kit -DCOMPILER=xtensa-esp32".)

espdorian
Posts: 33
Joined: Sat Dec 26, 2020 10:57 am

Re: Compiling example prject under windows attempts to use MSVC

Postby espdorian » Sun Dec 27, 2020 7:41 am

Thanks for the quick reply. The trick was to specify Ninja as the generator. Without specifying Ninja it attempts to use MSVC.
It is working now as expected :)

Who is online

Users browsing this forum: No registered users and 248 guests