How to get Adafruit ssd1306 examples to compile?

Hi Everybody.

I just started to explore Platformio , manage a few things , but bumped into a problem.

I added the Adafruit GFX and Adafruit SSD1306 Libraries.

I open the SSD1306 examples and copy that to src / main.cpp
When I compile the code I get errors.

Installed Libraries.

A small part of the example code.

display.display();
  delay(2000);
  // display.display() is NOT necessary after every single drawing command,
  // unless that's what you want...rather, you can batch up a bunch of
  // drawing operations and then update the screen all at once by calling
  // display.display(). These examples demonstrate both approaches...

  testdrawline();      // Draw many lines

  testdrawrect();      // Draw rectangles (outlines)

  testfillrect();      // Draw rectangles (filled)


The error message.

DEBUG: Current (avr-stub) External (avr-stub, simavr)
PACKAGES:
 - framework-arduino-avr @ 5.2.0
 - tool-avrdude @ 1.60300.200527 (6.3.0)
 - toolchain-atmelavr @ 1.70300.191015 (7.3.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 8 compatible libraries
Scanning dependencies...
Dependency Graph
|-- Adafruit GFX Library @ 1.12.1
|-- Adafruit SSD1306 @ 2.5.15
|-- SPI @ 1.0
|-- Wire @ 1.0
Building in release mode
Compiling .pio\build\pro8MHzatmega328\src\main.cpp.o
Archiving .pio\build\pro8MHzatmega328\libb3a\libSPI.a
Indexing .pio\build\pro8MHzatmega328\libb3a\libSPI.a
src\main.cpp: In function 'void setup()':
src\main.cpp:90:3: error: 'testdrawline' was not declared in this scope
   testdrawline();      // Draw many lines
   ^~~~~~~~~~~~
src\main.cpp:92:3: error: 'testdrawrect' was not declared in this scope
   testdrawrect();      // Draw rectangles (outlines)
   ^~~~~~~~~~~~
src\main.cpp:94:3: error: 'testfillrect' was not declared in this scope
   testfillrect();      // Draw rectangles (filled)
   ^~~~~~~~~~~~
src\main.cpp:96:3: error: 'testdrawcircle' was not declared in this scope
   testdrawcircle();    // Draw circles (outlines)
   ^~~~~~~~~~~~~~

You must predeclare each function before use. These are the rules of .cpp files. See

https://docs.platformio.org/en/latest/faq/ino-to-cpp.html

If you just want to quickly test it and then throw the code away, simply change main.cpp to main.ino. If you want to expand on this code, convert it properly per FAQ above.

Thanks I searched for more info and found an example , it is working now.