title: error: 'track_t' was not declared in this scope
body: <p>I'm fiddling with an Arduino project where I've got these structs in my main file:</p>
  
  <pre><code>struct gpsCoord_t {
    long latitude;
    long longitude; 
  };
  
  struct track_t {
    char code[4];
    gpsCoord_t bounds[4];
    gpsCoord_t points[4];
  };
  </code></pre>
  
  <p>Next to that I've got a function to dump variables of this type to the serial bus in that same file:</p>
  
  <pre><code>void dumpTrack(track_t track) {
    Serial.print("\nTrack: ");
    Serial.print(track.code);
    Serial.print("\nTrack bounds: ");
    Serial.print("\n- 1 lat: ");
    Serial.print(track.bounds[0].latitude);
    Serial.print("\n- 1 lon: ");
    Serial.print(track.bounds[0].longitude);
  }
  </code></pre>
  
  <p>The compiler produces 2 errors without line numbers from which I believe the first one is caused by the second one:</p>
  
  <pre><code>error: variable or field 'dumpTrack' declared void
  error: 'track_t' was not declared in this scope
  </code></pre>
  
  <p>EDIT here's the complete file:</p>
  
  <pre><code>#include &lt;Wire.h&gt; //I2C library
  #include &lt;I2C_eeprom.h&gt;
  #include &lt;SoftwareSerial.h&gt;
  #include &lt;TinyGPS.h&gt;
  
  I2C_eeprom ee(0x50);
  
  const int baseTrackAddress = 3;
  const int trackSize = 68;
  const int maxTracks = 480;
  
  int powerOnLED = 2;
  int gpsFixLED = 3;
  int trackFoundLED = 4;
  int errorLED = 6;
  int gpsSensor = 7;
  
  TinyGPS gps;
  SoftwareSerial nss(gpsSensor, 255);
  
  int calcTrackAddress(int trackId) {
    return (trackId*trackSize) + baseTrackAddress;
  }
  
  struct gpsCoord_t {
    long latitude;
    long longitude; 
  };
  
  struct track_t {
    char code[4];
    gpsCoord_t bounds[4];
    gpsCoord_t points[4];
  };
  
  track_t tracks[maxTracks];
  
  void setup() 
  {
    Serial.begin(115200);
    Serial.flush();
    Serial.print("Demo I2C eeprom library ");
    Serial.print(I2C_EEPROM_VERSION);
    Serial.println("\n");
  
    strcpy(tracks[0].code, "X11");
    tracks[0].bounds[0].latitude = 0;
    tracks[0].bounds[0].longitude = 0;
  
    tracks[0].points[0].latitude = 0;
    tracks[0].points[0].longitude = 0;
  
    ee.writeBlock(3, (uint8_t*)&amp;tracks[0], trackSize);
  }
  
  void loop() 
  {
    Serial.println("\nTEST: 64 byte page boundary writeBlock");
    dumpEEPROM(0, 255);
    while(1);
  }
  
  void dumpTrack(track_t track) {
    Serial.print("\nTrack: ");
    Serial.print(track.code);
    Serial.print("\nTrack bounds: ");
    Serial.print("\n- 1 lat: ");
    Serial.print(track.bounds[0].latitude);
    Serial.print("\n- 1 lon: ");
    Serial.print(track.bounds[0].longitude);
  }
  
  void readTrack(int trackId) {
    track_t track;
    ee.readBlock(60, (uint8_t*)&amp;track, 10);
  }
  
  void readTracks() {
  
  }
  
  void dumpEEPROM(unsigned int addr, unsigned int length)
  {
    // block to 10
    addr = addr / 10 * 10;
    length = (length + 9)/10 * 10;
  
    byte b = ee.readByte(addr); 
    for (int i = 0; i &lt; length; i++) 
    {
      if (addr % 10 == 0)
      {
        Serial.println();
        Serial.print(addr);
        Serial.print(":\t");
      }
      Serial.print(b);
      b = ee.readByte(++addr); 
      Serial.print("  ");
    }
    Serial.println();
  }
  
  void ProcessCommand(char* command) {
    //switch(*command==) 
  }
  
  char* ReadSerialCommand() {
    int i=0;
    char commandbuffer[100];
  
    if(Serial.available()){
       delay(100);
       while( Serial.available() &amp;&amp; i&lt; 99) {
          commandbuffer[i++] = Serial.read();
       }
       commandbuffer[i++]='\0';
    }
  
    if(i&gt;0)
      return (char*)commandbuffer; 
    else
      return 0L;
  }
  </code></pre>
  
  <p>When I put the entire dumpTrack function in comment, the errors go away. I've checked a couple of times for a typo but failed to find any.</p>