Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8427859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:53:39+00:00 2026-06-10T04:53:39+00:00

I’m fiddling with an Arduino project where I’ve got these structs in my main

  • 0

I’m fiddling with an Arduino project where I’ve got these structs in my main file:

struct gpsCoord_t {
  long latitude;
  long longitude; 
};

struct track_t {
  char code[4];
  gpsCoord_t bounds[4];
  gpsCoord_t points[4];
};

Next to that I’ve got a function to dump variables of this type to the serial bus in that same file:

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);
}

The compiler produces 2 errors without line numbers from which I believe the first one is caused by the second one:

error: variable or field 'dumpTrack' declared void
error: 'track_t' was not declared in this scope

EDIT here’s the complete file:

#include <Wire.h> //I2C library
#include <I2C_eeprom.h>
#include <SoftwareSerial.h>
#include <TinyGPS.h>

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*)&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*)&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 < 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() && i< 99) {
        commandbuffer[i++] = Serial.read();
     }
     commandbuffer[i++]='\0';
  }

  if(i>0)
    return (char*)commandbuffer; 
  else
    return 0L;
}

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T04:53:41+00:00Added an answer on June 10, 2026 at 4:53 am

    It seems you are compiling this code as C.

    Instead of

    struct track_t {
      char code[4];
      gpsCoord_t bounds[4];
      gpsCoord_t points[4];
    };
    

    write

    typedef struct {
      char code[4];
      gpsCoord_t bounds[4];
      gpsCoord_t points[4];
    } track_t;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I've got a string that has curly quotes in it. I'd like to replace
I want use html5's new tag to play a wav file (currently only supported
In my XML file chapters tag has more chapter tag.i need to display chapters
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.