Page 1 of 1

Fatal Compile Error(s)

Posted: Wed Oct 08, 2025 5:44 pm
by YellowGTM
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!

Re: Fatal Compile Error(s)

Posted: Thu Oct 09, 2025 1:02 am
by YellowGTM
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.

Re: Fatal Compile Error(s)

Posted: Thu Oct 09, 2025 5:43 am
by horace99
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 ?

Re: Fatal Compile Error(s)

Posted: Fri Oct 10, 2025 2:35 am
by YellowGTM
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 6694 times
I'll see about getting the core number as well!

Re: Fatal Compile Error(s)

Posted: Fri Oct 10, 2025 4:11 am
by lbernstone
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.

Re: Fatal Compile Error(s)

Posted: Tue Nov 04, 2025 11:28 pm
by YellowGTM
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 6528 times
esp32S3.jpg
esp32S3.jpg (329.86 KiB) Viewed 6528 times