Can't include the TinyGSM library in my esp-idf project, can't compile code

I am new to platformIO and tried to create a clean project where I can use the esp-idf framework with c++ libraries. In particular I am trying to use the TinyGSM library but I can’t compile my project. I installed the library to my project from the PIO libraries page and renamed my main.c to main.cpp as I want to write my code in c++ but have not made any changes in the project after that.

Is it not possible to use c++ with esp-idf or do I need to do additional setup before it works?

This is what my .ini file looks like,

; PlatformIO Project Configuration File
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
; Please visit documentation for the other options and examples

platform = espressif32
board = esp-wrover-kit
framework = espidf
lib_deps = 

and this is what my main.cpp looks like

#include <TinyGsmClient.h>

extern "C" {void app_main(void){}}

void app_main(void) {}

and i get this error when running the compiler.

I have tried to restart VS code, re-installed the library, added the library in /lib/ instead but I cant seem to get it working.

Have I done my setup incorrectly?

The library is not ESP-IDF compatible. It requires the Arduino abstraction layer.

Add the Arduino framework in the mix, or switch to that framework, or use a different GSM library, or port the TinyGSM library from Arduino to ESP-IDF.

PlatformIO respects the compatibility settings of the TinyGSM library and excludes it from the build, hence “Include not found”.

The very same goes for marcoschwartz/LiquidCrystal_I2C .

Thank you for the reply! I did not realize it was only supported by the Arduino framework :sweat_smile:
I tried to make the combined environment and this worked for me :grinning:.

Just a question for curiosity. When you mention “port the TinyGSM library from Arduino to ESP-IDF” does this just include converting libraries such as Wire and other Arduino framework specific libraries to ESP-IDF or is there more to it? To me it seems like its all just source and header files after that but I am quite new to all these environments, frameworks and the likes. Again, thank you for the great answer!