Exit status 1, maybe a problem with }

Im trying to compile this code:

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

// See the following for generating UUIDs:
// https://www.uuidgenerator.net/

#define SERVICE_UUID        "4fafc201-1fb5-459e-8fcc-c5c9c331914b"
#define CHARACTERISTIC_UUID "beb5483e-36e1-4688-b7f5-ea07361b26a8"

void setup() {
  Serial.begin(115200);
  Serial.println("Starting BLE work!");

  BLEDevice::init("MyESP32");
  BLEServer *pServer = BLEDevice::createServer();
  BLEService *pService = pServer->createService(SERVICE_UUID);
  BLECharacteristic *pCharacteristic = pService->createCharacteristic(
                                         CHARACTERISTIC_UUID,
                                         BLECharacteristic::PROPERTY_READ |
                                         BLECharacteristic::PROPERTY_WRITE
                                       );

  pCharacteristic->setValue("Hello World says Neil");
  pService->start();
  // BLEAdvertising *pAdvertising = pServer->getAdvertising();  // this still is working for backward compatibility
  BLEAdvertising *pAdvertising = BLEDevice::getAdvertising();
  pAdvertising->addServiceUUID(SERVICE_UUID);
  pAdvertising->setScanResponse(true);
  pAdvertising->setMinPreferred(0x06);  // functions that help with iPhone connections issue
  pAdvertising->setMinPreferred(0x12);
  BLEDevice::startAdvertising();
  Serial.println("Characteristic defined! Now you can read it in your phone!");
}

void loop() {
  // put your main code here, to run repeatedly:
  delay(2000);
}

Im getting this error:

during GIMPLE pass: profile_estimate
/home/panchines/.arduino15/packages/esp32/hardware/esp32/3.0.5/libraries/BLE/src/BLEClient.cpp: In member function 'void std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_construct_node(_Link_type, _Args&& ...) [with _Args = {std::pair<BLERemoteService*, short unsigned int>}; _Key = BLERemoteService*; _Val = std::pair<BLERemoteService* const, short unsigned int>; _KeyOfValue = std::_Select1st<std::pair<BLERemoteService* const, short unsigned int> >; _Compare = std::less<BLERemoteService*>; _Alloc = std::allocator<std::pair<BLERemoteService* const, short unsigned int> >]':
/home/panchines/.arduino15/packages/esp32/hardware/esp32/3.0.5/libraries/BLE/src/BLEClient.cpp:583:1: internal compiler error: Segmentation fault
  583 | }  // toString
      | ^
0x75c17104251f ???
	./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x75c171029d8f __libc_start_call_main
	../sysdeps/nptl/libc_start_call_main.h:58
0x75c171029e3f __libc_start_main_impl
	../csu/libc-start.c:392

exit status 1

Compilation error: exit status 1

Thanks!

I can not confirm your findings. Your code compiles with Windows 10, ide 1.8.19, esp core 3.0.0-rc3 and library BLE at version 2.0.0 in folder: Arduino15\packages\esp32\hardware\esp32\3.0.0-rc3\libraries\BLE.

The Arduino BLE library is not in my library folder, only the ESP32 BLE library bundled with the core.

If you enable File>Preferences>show verbose output during compile, can you post the complete message you get.

Try updating your libraries. This error says the file mentioned, line 583, character 1, is wanting a close brace, indicating line 582 might be lacking the close brace.

Thanks!
Yep, was that!
But, i just install the arduino ide.
In the other hand what i do was go to the github related and copy paste the code in the file manually.
But, how do you update the libraries automatically? I have 2.3.3 version. Thanks

For the libraries which come bundled with the Arduino Core for the ESP32 I think they will update with each new update of the board package.

Take a look at the Arduino15\packages\esp32\hardware\esp32\your version\libraries file to see what comes with the board package.

When your start your IDE, the libraries will be checked for updates and you will be given the option to install them before continuing with the IDE.

I think is is only for libraries through the IDE library manager, and it doesn't apply to the bundled ESP core libraries.

Quite often the first step in getting everything "all messed up"

lol, i know that is why i ask how do this automatically.
It is weird that those files where not updated when i start the IDE, but maybe @cattledog have right.
Thanks

I assumed Arduino/AVR. Sorry.