Fatal Compile Error(s)

YellowGTM
Posts: 5
Joined: Wed Oct 08, 2025 5:26 pm

Fatal Compile Error(s)

Postby YellowGTM » Wed Oct 08, 2025 5:44 pm

First off, Hello - it's my first post as you can see.

Second, yes I've done searches on here, and Google for several days. I'm not smart enough
to figure this out, hence my new registration on this forum!

Hardware/Software/IDE:
Expressif ESP32-S3-WROOM-1
Libraries: installed ESP32 by ExpressIF
Arduino IDE 1.8.4, and Arduino IDE 2.3.4


I've successfully connected to my ESP32-S3 (dev kit, with adapter board). The code worked,
the LED flashed, I was able to change the duration of the LED on-time, etc. So, connecting
and manipulation is fine on basic code.

Now, I'm trying to get Bluetooth to work, which I understand is only supported with BLE
library files.

I've added the "ESP32_BLE_Arduino-master" and "esp32-snippets-master" libraries.

The code and Errors as follows when selecting various "ESP32S3" options from the board menu.
Selected as:
* ESP32 Dev Module
* ESP32S3 Dev Module
* ESP32-S3-Box

Code: Select all

    #include <BLEDevice.h>
    #include <BLEUtils.h>
    #include <BLEServer.h>
    #include <BLEService.h>
    #include <BLECharacteristic.h>

    BLEServer* pServer = nullptr;
    BLEService* pService = nullptr;
    BLECharacteristic* pCharacteristic = nullptr;

    void setup() {
      BLEDevice::init("ESP32_Metadata"); // Device name
      pServer = BLEDevice::createServer();
      pService = pServer->createService("UUID_SERVICE"); // Your service UUID

      pCharacteristic = pService->createCharacteristic(
                            "UUID_CHARACTERISTIC", // Your characteristic UUID
                            BLECharacteristic::PROPERTY_READ |
                            BLECharacteristic::PROPERTY_NOTIFY
                         );

      pService->start();
      pServer->getAdvertising()->start();
    }

    void loop() {
      // Update characteristic value with your metadata
      pCharacteristic->setValue("Your Metadata Here");
      pCharacteristic->notify();
      delay(2000);
    }
Errors:

fatal error: esp_gap_ble_api.h: No such file or directory
12 | #include <esp_gap_ble_api.h> // ESP32 BLE
| ^~~~~~~~~~~~~~~~~~~

Multiple libraries were found for "BLEDevice.h"
exit status 1
Error compiling for board ESP32S3 Dev Module.

I've tried getting updates from GitHub, removing libraries, updating the IDE board manager version, etc.

Thank you in advance for any tips, suggestions, library reference, to help me get started with the ESP32!

YellowGTM
Posts: 5
Joined: Wed Oct 08, 2025 5:26 pm

Re: Fatal Compile Error(s)

Postby YellowGTM » Thu Oct 09, 2025 1:02 am

A little FYI:

I've installed the Expressif IDK to see if I can compile some sample code. I believe that's
Python language, but at least it will help determine a path...

I'd rather use the Arduino IDE, so I don't have to learn a language immediately.

horace99
Posts: 34
Joined: Mon Oct 14, 2024 10:38 am

Re: Fatal Compile Error(s)

Postby horace99 » Thu Oct 09, 2025 5:43 am

the code of post 1 compiles and links OK on my PC
Windows 11 Arduino IDE 2.3.4 ESP32 core 3.3.2

which ESP32 core are you using?
have you tried the BLE examples under File>Examples>BLE ?

YellowGTM
Posts: 5
Joined: Wed Oct 08, 2025 5:26 pm

Re: Fatal Compile Error(s)

Postby YellowGTM » Fri Oct 10, 2025 2:35 am

Thanks for the response, @horrace99

The code in the OP was copied from a site, based on the library examples (GitHub, I think?)

When I go to examples, this is what I see. I think we're onto something:
incompatibleLibrary.png
incompatibleLibrary.png (53.7 KiB) Viewed 6689 times
I'll see about getting the core number as well!

lbernstone
Posts: 1131
Joined: Mon Jul 22, 2019 3:20 pm

Re: Fatal Compile Error(s)

Postby lbernstone » Fri Oct 10, 2025 4:11 am

You should remove any additional libraries you have added for BLE, as the BLE library is included in the core code you install for Arduino ESP32. It is complaining about extra libraries, and getting confused about what to install, since there is overlap.

YellowGTM
Posts: 5
Joined: Wed Oct 08, 2025 5:26 pm

Re: Fatal Compile Error(s)

Postby YellowGTM » Tue Nov 04, 2025 11:28 pm

Thanks for the tip. I didn't anticipate this much trouble starting off, but
I've made some progress since the last post, with help from all of you.

I've essentially updated the IDE, removed any recent Bluetooth/BLE libraries
and started over.

Was able to upload code, communicate, manipulate, etc. For those that
are experiencing the same troubles, I read a thread on this forum with
respect to "Bluedroid" and "NimBLE" compatibility.

viewtopic.php?t=35193

With the NimBLE libraries, I was able to get up and running.
workingCode.png
workingCode.png (31.44 KiB) Viewed 6523 times
esp32S3.jpg
esp32S3.jpg (329.86 KiB) Viewed 6523 times

Who is online

Users browsing this forum: PerplexityBot and 2 guests