This is not the fault of the toolchain. The core you’re using in teh Arduino IDE is not https://github.com/espressif/arduino-esp32/ but Heltec’s forked core, from https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/releases/download/0.0.9/package_heltec_esp32_index.json
. PlatformIO is only having native support for Espressif’s core, not Heltec’s modded core. As thus, you are missing special precompiled libraries presented in the Heltec fork which implement the Mcu
object and class that you’re missing in your sketch.
This has been discussed already in Heltec WiFi_LoRa_32_V3 Compile Error - undefined reference to `Radio' - #7 by fazer666 with a reference project.