Home \ Help \ Search \ Login RSS

Welcome, Guest. Please Login

This forum is now READ-ONLY! Please visit http://forum.wiring.co/ for the new forum.

Wiring ForumProgramming Questions & HelpSyntax › Strange struct behaviour?

Page Index Toggle Pages: 1
Strange struct behaviour? (Read 3324 times)
01/28/09 at 19:19:25

redman   Offline
YaBB Newbies

Posts: 8
*
 
Hi all,

Using Wiring 0018.

I have this code fragment in a header file:

...
typedef struct  {
   static  int Timer;
   static  int timeout;
   static  int TimerMax;
   static  int Timer2;
   static  int TimeOut2;
   static  int TimerMax2;
   static  int Timer3;
   static  int TimeOut3;
   static  int TimerMax3;
} CamTimers;

static CamTimers globalTim[7];
...


then i use the structure in a function :

char* WaitForAnswer(char portnum, char camnum, int timeout) {
...
    globalTim[camnum  - 1].Timer3 = 0;
...
}

and i get a compile error:

o: In function `WaitForAnswer(char, char, int)':
undefined reference to `._2::Timer3'

:(

anyone knows what's going on?

thanks
 
IP Logged
 
Reply #1 - 01/28/09 at 21:23:01

redman   Offline
YaBB Newbies

Posts: 8
*
 
Never mind,

I removed the static identifiers inside the struct and now it compiles.
 
IP Logged
 
Page Index Toggle Pages: 1