Compiler throwing big error message?

For problems with Gamebuino itself, NOT your project

Compiler throwing big error message?

Postby Montiey » Sat Feb 28, 2015 8:22 pm

So, I just updated my version of the Arduino IDE to version 1.6.0, and when I re-installed the library and hardware folders for gamebuino, I got this message:
Code: Select all
Arduino: 1.6.0 (Mac OS X), Board: "Arduino Uno"

Build options changed, rebuilding all
Using library SPI in folder: /Applications/Arduino/Arduino.app/Contents/Resources/Java/hardware/arduino/avr/libraries/SPI

/Applications/Arduino/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10600 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/Applications/Arduino/Arduino.app/Contents/Resources/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino/Arduino.app/Contents/Resources/Java/hardware/arduino/avr/variants/standard -I/Applications/Arduino/Arduino.app/Contents/Resources/Java/hardware/arduino/avr/libraries/SPI /var/folders/lz/t6b0h62d0l14shb28mmr1b9w0000gn/T/build3534859159284368520.tmp/Bugg.cpp -o /var/folders/lz/t6b0h62d0l14shb28mmr1b9w0000gn/T/build3534859159284368520.tmp/Bugg.cpp.o
Bugg.ino:4:23: fatal error: Gamebuino.h: No such file or directory
compilation terminated.
Error compiling.

I was trying to compile this program, which is coming along nicely thanks to all your help (until now :P):
Code: Select all
//imports the SPI library (needed to communicate with Gamebuino's screen)
#include <SPI.h>
//imports the Gamebuino library
#include <Gamebuino.h>
//creates a Gamebuino object named gb
Gamebuino gb;

static unsigned char PROGMEM logo[]=
{
  40,12,
  B00111100, B00110000, B11000011, B11000000, B11110000,
  B00111100, B00110000, B11000011, B11000000, B11110000,
  B11000011, B00110000, B11001100, B00110011, B00001100,
  B11000011, B00110000, B11001100, B00110011, B00001100,
  B11000011, B00110000, B11001100, B00000011, B00000000,
  B11000011, B00110000, B11001100, B00000011, B00000000,
  B11111100, B00110000, B11001100, B11000011, B00110000,
  B11111100, B00110000, B11001100, B11000011, B00110000,
  B11000011, B00110000, B11001100, B00110011, B00001100,
  B11000011, B00110000, B11001100, B00110011, B00001100,
  B00111100, B00001111, B00000011, B11000000, B11110000,
  B00111100, B00001111, B00000011, B11000000, B11110000,
};

static unsigned char PROGMEM player[]=
{
  8,8,
  B00111100,
  B01000010,
  B10100101,
  B10000001,
  B10100101,
  B10011001,
  B01000010,
  B00111100,
};

static unsigned char PROGMEM item2[]=
{
  8,8,
  B10100101,
  B01111110,
  B00111100,
  B01100110,
  B10111101,
  B00100100,
  B01111110,
  B10011001,
};

static unsigned char PROGMEM item1[]=
{
  8,8,
  B11001010,
  B11001011,
  B11001011,
  B11111111,
  B10000001,
  B10000001,
  B10000001,
  B11111111,
};

int score = 0; // score
int item1_quantity = 0;
int item2_quantity = 0;
int player_x = LCDWIDTH/2; //set the horizontal position to the middle of the screen
int player_y = LCDHEIGHT/2; //vertical position
int player_vx = 1; //horizontal velocity
int player_vy = 1; //vertical velocity
int player_size = 8; //the size of the player in number of pixels
int item1_size = 6; //SE
int item1_x = 30; //initial X position of item1
int item1_y = 10; //initial Y position of item1
int item2_size = 8; //SE
int item2_x = 40; //initial X position of item2
int item2_y = 2; //initial Y position of item2
int item2timer = 0;
boolean redon = false;
boolean greenon = false;
int red = 0;
int green = 0;
int redout = A5;
int greenout = A4;
boolean intro = false;
int time = 200;

// the setup routine runs once when Gamebuino starts up
void setup(){
  pinMode(redout, OUTPUT);
  pinMode(greenout, OUTPUT);
  // initialize the Gamebuino object
  gb.begin();
  //display the main menu:
  gb.titleScreen(F("Work In Progress"), logo);
}

// the loop routine runs over and over again forever
void loop(){
  while(1){
    if(gb.update()){
      if(intro == false){
        gb.popup(F("A-fast B-slow"), 40);
        intro = true;
      }
      if(time <= 0){
        while(true){
          if(gb.update()){
            gb.display.println("Game over!!");
            gb.display.print("$"); gb.display.println(score);
            gb.display.print("Cherries: "); gb.display.println(item1_quantity);
            gb.display.print("Bombs: "); gb.display.println(item2_quantity);
            if(gb.buttons.pressed(BTN_C)){
              gb.titleScreen(F("Work In Progress"), logo);
              int score = 0; // score
              int item1_quantity = 0;
              int item2_quantity = 0;
              int item2timer = 0;
              boolean redon = false;
              boolean greenon = false;
              int red = 0;
              int green = 0;
              int redout = A5;
              int greenout = A4;
              boolean intro = false;
              int time = 200;
              break;
            }
          }
        }
      }
      time -= 1;
      if(redon == true){
        digitalWrite(redout, HIGH);
        red += 1;
      }
      if(red >= 10){
        red = 0;
        redon = false;
        digitalWrite(redout, LOW);
      }
      if(greenon == true){
        digitalWrite(greenout, HIGH);
        green += 1;
      }
      if(green >= 10){
        green = 0;
        greenon = false;
        digitalWrite(greenout, LOW);
      }
      //item1 system
      if(gb.collideBitmapBitmap( player_x,  player_y,  player, item1_x, item1_y, item1)){
        item1_x = random(0, LCDWIDTH - item1_size);
        item1_y = random(0, LCDHEIGHT - item1_size);
        score += 1;
        item1_quantity += 1;
        greenon = true;
        gb.sound.playOK();
      }
      //item2 system
      if(item2timer >= 40){
        item2timer = 0;
        item2_x = random(0, LCDWIDTH - item2_size);
        item2_y = LCDHEIGHT - item2_size;
        gb.sound.playTick();
      }
      item2timer += 1;
      item2_y -= 1;
      if(gb.collideBitmapBitmap( player_x,  player_y,  player, item2_x, item2_y, item2)){
        item2_y = LCDHEIGHT - item2_size;
        item2_x = random(0, LCDWIDTH - item2_size);
        item2timer = 0;
        score -= 2;
        item2_quantity += 1;
        redon = true;
        gb.sound.playCancel();
      }
      //move the  player using the buttons
      if(gb.buttons.repeat(BTN_RIGHT,2)){ //every 2 frames when the right button is held down
        player_x =  player_x +  player_vx; //increase the horizontal position by the  player's velocity
      }
      if(gb.buttons.repeat(BTN_LEFT,2)){
        player_x =  player_x -  player_vx;
      }
      if(gb.buttons.repeat(BTN_DOWN,2)){
        player_y =  player_y +  player_vy;
      }
      if(gb.buttons.repeat(BTN_UP,2)){
        player_y =  player_y -  player_vy;
      }
      //speed selection
      if(gb.buttons.pressed(BTN_A)){
        gb.popup(F("SLOW"), 500);
        gb.sound.playTick();
        player_vx = 5;
        player_vy = 5;
      }
      if(gb.buttons.pressed(BTN_B)){
        gb.popup(F("SLOW"), 500);
        gb.sound.playTick();
        player_vx = 2;
        player_vy = 2;
      }
      if( player_x < 0){
        //bring it back in the screen
        player_x = 0;
      }
      //if the  player is touching the right side
      if(( player_x +  player_size) > LCDWIDTH){
        player_x = LCDWIDTH -  player_size;
      }
      //if the  player is touching the top side
      if( player_y < 0){
        player_y = 0;
      }
      //if the  player is touching the down side
      if(( player_y +  player_size) > LCDHEIGHT){
        player_y = LCDHEIGHT -  player_size;
      }
      //draw the  player on the screen
      gb.display.print("$ ");
      gb.display.println(score);
      gb.display.drawBitmap(player_x, player_y, player);
      gb.display.drawBitmap(item1_x,item1_y,item1);
      gb.display.drawBitmap(item2_x,item2_y,item2);
      if(gb.buttons.pressed(BTN_C)){
        gb.titleScreen(F("Game Paused"), logo);
      }
    }
  }
}

What could be wrong?
User avatar
Montiey
 
Posts: 68
Joined: Sat Jan 17, 2015 5:38 pm

Re: Compiler throwing big error message?

Postby rodot » Sun Mar 01, 2015 7:48 am

Hey,
In the error message you have
Code: Select all
Bugg.ino:4:23: fatal error: Gamebuino.h: No such file or directory

Which means the compiler couldn't find the file Gamebuino.h, i.e. the Gamebuino Library. Either you deleted it or put it in the wrong location. It has to be in <sketchbook folder>/libraries/Gamebuino (see Getting Started). You can change the location of your sketchbook folder in the Arduino IDE by clicking File/Preferences/Sketchbook location.

My advice would be to re-do the getting started instructions from the beginning. Also you should download the beta branch of the Gamebuino Library, which supports the new version 1.6 of the Arduino IDE.
User avatar
rodot
Site Admin
 
Posts: 1290
Joined: Mon Nov 19, 2012 11:54 pm
Location: France

Re: Compiler throwing big error message?

Postby Montiey » Sun Mar 01, 2015 2:48 pm

Aha! I knew I had the hardware and library folders in the right place, but I had no idea that there was a beta branch for the newer versions of Arduino. Thanks!

Also, I had to change
Code: Select all
static unsigned char PROGMEM item1[]=

to
Code: Select all
const unsigned char PROGMEM item1[]=

for the program to compile, but it runs just the same. Is this something I should worry about?
User avatar
Montiey
 
Posts: 68
Joined: Sat Jan 17, 2015 5:38 pm


Return to Installation & Troubleshooting

Who is online

Users browsing this forum: No registered users and 8 guests

cron