Jump to content

Can't Compile Array-of-structures With Initialiser


Recommended Posts

Hi

 

I'm trying to compile a bit of C with the following fragment in it:

 

struct icon {

unsigned char x, y;

} icon[6] = { // This is line 89

{ 10, 6 },

{ 10, 7 },

{ 10, 8 },

{ 9, 7 },

{ 10, 7 },

( 10, 9 }

};

 

... and I get the following error:

 

flash.c

Starting preprocessor: "C:\Program Files\SourceBoost\pp.exe" "C:\Documents and Settings\Mark.GRUMPY\My Documents\My Documents\Flash\flash.c" -i "C:\Program Files\SourceBoost\include" -i boostc_libs_r1_3\libs -d _PIC18F4523 -la -c2 -o flash.pp -v -d _BOOSTC -d _PIC18

 

C:\Documents and Settings\Mark.GRUMPY\My Documents\My Documents\Flash\flash.c(89): error: missing semicolon

C:\Documents and Settings\Mark.GRUMPY\My Documents\My Documents\Flash\flash.c(89): error: failure

 

My compiler (running under MPLAB) is:

 

BoostC Optimizing C Compiler Version 6.84 (for PIC18 architecture)

 

Any ideas? I've tried things like changing x to xx and y to yy with no change to the problem.

 

Thanks!

 

M

Link to post
Share on other sites

MarkM,

BoostC Optimizing C Compiler Version 6.84 (for PIC18 architecture)

 

Any ideas? I've tried things like changing x to xx and y to yy with no change to the problem.

 

Thanks!

 

M

Complex initialisation was added in BoostC V6.86, so you need to upgrade.

The version log can be found here: http://www.sourceboost.com/CommonDownload/VersionLog.html

 

Regards

Dave

Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...