Error compiling for board Arduino Uno

i have a problem with my code Error compiling for board Arduino Uno. keep coming up and i installed the Adafruit SSD1306 i don't know what to do im also using the audino R3 my code is

// ultramegabombasticfuze on https://projecthub.arduino.cc/

// Screen: VCC-5V GND-GND SCL-A5 SDA-A4
//Button: 1pin-GND (with a resistor 10KO) 2pin-5V 3pin-D7 4pin-empty

#include <Adafruit_SSD1306.h>

#define BUTTON_PIN 7  // Pin connected to the button

bool isJumping = false;
int dinoY = 40;
int velocity = 0;
const int gravity = 2;
const int groundY = 40;
int cactusX = 128;

Adafruit_SSD1306 display(128, 64, &Wire, -1);

void setup() {
    pinMode(BUTTON_PIN, INPUT);  // Set BUTTON_PIN as input
    
    if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
        while (1);  // If the display is not initialized, stop the program
    }
    
    display.clearDisplay();
}

void loop() {
    static bool buttonPressed = false;
    
    // Button is pressed when the signal is HIGH (due to direct connection to 5V)
    if (digitalRead(BUTTON_PIN) == HIGH && !buttonPressed) {
        buttonPressed = true;
        isJumping = true;
        velocity = -10;  // Jump power
        delay(50);  // Debounce delay to avoid multiple presses
    } 
    
    if (digitalRead(BUTTON_PIN) == LOW) {
        buttonPressed = false; // Reset when button is released
    }

    // Handle jumping physics
    if (isJumping) {
        dinoY += velocity;
        velocity += gravity;
        if (dinoY >= groundY) {
            dinoY = groundY;
            isJumping = false;
        }
    }

    // Move cactus
    cactusX -= 3;
    if (cactusX < -10) cactusX = 128;

    // Draw scene
    display.clearDisplay();
    display.fillRect(10, dinoY, 10, 10, SSD1306_WHITE); // Dino
    display.fillRect(cactusX, groundY, 10, 15, SSD1306_WHITE); // Cactus
    display.drawLine(0, 58, 128, 58, SSD1306_WHITE); // Ground
    display.display();

    // Collision detection
    if (cactusX < 20 && cactusX > 5 && dinoY == groundY) { // Check if the dino is on the ground and cactus is near
        display.clearDisplay();
        display.setTextSize(2);
        display.setTextColor(SSD1306_WHITE);
        display.setCursor(20, 20);
        display.print("Game Over");
        display.display();
        while (1); // Stop the game after Game Over
    }

    delay(50);  // Delay for smooth gameplay
}

Hi @pastlinko. I'm going to ask you to provide the full output from a compilation.


:red_exclamation_mark: This procedure is not intended to solve the problem. The purpose is to gather more information.


Please do this:

  1. Select Sketch > Verify/Compile from the Arduino IDE menus.
  2. Wait for the compilation to fail.
  3. You will see a "Compilation error: ..." notification at the bottom right corner of the Arduino IDE window. Click the "COPY ERROR MESSAGES" button on that notification.
  4. Open a reply here on this forum topic by clicking the "Reply" button.
  5. Click the <CODE/> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
  6. Press the Ctrl+V keyboard shortcut (Command+V for macOS users).
    This will paste the compilation output into the code block.
  7. Move the cursor outside of the code block markup before you add any additional text to your reply.
  8. Click the "Reply" button to publish the post.

In case the output is longer than the forum software will allow to be added to a post, you can instead save it to a .txt file and then attach that file to a reply here.

Click here for attachment instructions

  1. Open any text editor program.
  2. Paste the copied output into the text editor.
  3. Save the file in .txt format.
  4. Open a reply here on this forum topic by clicking the "Reply" button.
  5. Click the "Upload" icon (Upload icon) on the post composer toolbar:

    The "Open" dialog will open.
  6. Select the .txt file you saved from the "Open" dialog.
  7. Click the "Open" button.
    The dialog will close.
  8. Click the "Reply" button to publish the post.

Alternatively, instead of using the "Upload" icon on the post composer toolbar as described in steps (5) - (7) above, you can simply drag and drop the .txt file onto the post composer field to attach it.

Had you included the error you are seeing, you likely would have already had an answer to your problem.