PlatformIO Community

CodeBlocks+ PIO + ESPDIF won't compile. ->Could not find “sdkconfig.json” file

Hello,
im trying to compile the project in codeblocks, but getting the following error:

--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32doit-devkit-v1.html
PLATFORM: Espressif 32 1.12.3 > DOIT ESP32 DEVKIT V1
HARDWARE: ESP32 160MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-espidf 3.40001.200521 (4.0.1) 
 - tool-cmake 3.16.4 
 - tool-esptoolpy 1.20600.0 (2.6.0) 
 - tool-ninja 1.7.1 
 - toolchain-esp32ulp 1.22851.190618 (2.28.51) 
 - toolchain-xtensa32 2.80200.200226 (8.2.0)
Reading CMake configuration...
Error: Couldn't find the main target of the project!
Warning: Could not find "sdkconfig.json" file
========================== [FAILED] Took 1.59 seconds ==========================
Process terminated with status 1 (0 minute(s), 2 second(s))
1 error(s), 1 warning(s) (0 minute(s), 2 second(s))

The platformio.ini :

[env:esp32doit-devkit-v1]
platform = espressif32
board = esp32doit-devkit-v1
framework = espidf
monitor_speed = 115200
lib_deps = 
	id=246@^2.6.2
	ESPUI
	ESPAsyncWebserver
	64
	ESPAsyncTCP
board_build.f_cpu = 160000000L

should i change the “framework” to “Arduino” - i get the project to compile.

the main.cpp:
 #include <time.h>
#include "sdkconfig.h"
#include "driver/gpio.h"
#include "esp_log.h"

#include <Sensor_DHT.h>
#include <sensor.h>
#include <gui.h>
#include <net.h> 

PIO lib list:

[az@dell5000 Proj_arduino]$ ~/.platformio/penv/bin/pio lib list
    Library Storage: /home/az/Work/Arduino/Proj_arduino/.pio/libdeps/esp32doit-devkit-v1
    ArduinoJson
===========
#ID: 64
A simple and efficient JSON library for embedded C++. ArduinoJson supports ✔ serialization, ✔ deserialization, ✔ MessagePack, ✔ fixed allocation, ✔ zero-copy, ✔ streams, ✔ filtering, and more. It is the most popular Arduino library on GitHub ❤❤❤❤❤. Check out arduinojson.org for a comprehensive documentation

Version: 6.15.2
    Homepage: https://arduinojson.org/?utm_source=meta&utm_medium=library.json
    Keywords: web, json, http, rest
    Compatible frameworks: arduino
    Compatible platforms: atmelavr, atmelmegaavr, atmelsam, espressif32, espressif8266, gd32v, infineonxmc, intel_arc32, kendryte210, microchippic32, nordicnrf51, nordicnrf52, ststm32, ststm8, teensy, timsp430
    Authors: Benoit Blanchon

AsyncTCP
========
#ID: 1826
Asynchronous TCP Library for ESP32

Version: 1.1.1
License: LGPL-3.0
Keywords: async, tcp
Compatible frameworks: arduino
Compatible platforms: espressif32
Authors: Hristo Gochkov

ESP Async WebServer
===================
#ID: 306
Asynchronous HTTP and WebSocket Server Library for ESP8266 and ESP32

Version: 1.2.3
License: LGPL-3.0
Keywords: async, websocket, http, webserver
Compatible frameworks: arduino
Compatible platforms: espressif32, espressif8266
Authors: Hristo Gochkov

ESPAsyncTCP
===========
#ID: 305
Asynchronous TCP Library for ESP8266

Version: 1.2.2
License: LGPL-3.0
Keywords: async, tcp
Compatible frameworks: arduino
Compatible platforms: espressif8266
Authors: Hristo Gochkov

ESPUI
=====
#ID: 1917
ESP32 and ESP8266 Web Interface Library

Version: 2.0.0
Keywords: espressif, web, interface, iot, control, simple, easy, ui, userinterface
Compatible frameworks: arduino
Compatible platforms: atmelavr, atmelmegaavr, atmelsam, espressif32, espressif8266, gd32v, infineonxmc, intel_arc32, kendryte210, microchippic32, nordicnrf51, nordicnrf52, ststm32, ststm8, teensy, timsp430
Authors: Lukas Bachschwell

RCSwitch
========
#ID: 246
Use your Arduino or Raspberry Pi to operate remote radio controlled devices

Version: 2.52
Keywords: wireless, rf, radio
Compatible frameworks: energia, wiringpi, arduino
Compatible platforms: atmelavr, atmelsam, espressif8266, intel_arc32, linux_arm, microchippic32, nordicnrf51, teensy, timsp430, titiva
Authors: Suat Ozgur

PlatformIO, version 4.3.4

Please advise.

You have specified that you want to compile for the espidf framewokr but you are including Arduino libraries which are not compatible by default.

ESP-IDF project need to have specific files (CMakeList.txt etc), see https://github.com/platformio/platform-espressif32/tree/develop/examples/espidf-blink. Without these, errors occur.

Spot on! Thank you., Maximillian