When i use Wire.h in my project its get error

hi. recently i write a project that i havve to use wire.h for using i2c
but when i use this i get this error

/home/emad/.platformio/packages/framework-arduinoespressif32/cores/esp32/Printable.h:25:1: error: unknown type name 'class'
 class Print;
/home/emad/.platformio/packages/framework-arduinoespressif32/cores/esp32/Printable.h:33:1: error: unknown type name 'class'
 class Printable
/home/emad/.platformio/packages/framework-arduinoespressif32/cores/esp32/Printable.h:34:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token

Can anyone help me about that ?

The only way that class can be an error is if you’re including it from a .c file since C has no classes. Wire is a C++ library, same as most of the Arduino core. Are you sure you’re writing your code in a .cpp file?