CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

UNION Problem when Porting from 3.236 to 3.249

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
jecottrell



Joined: 16 Jan 2005
Posts: 559
Location: Tucson, AZ

View user's profile Send private message

UNION Problem when Porting from 3.236 to 3.249
PostPosted: Thu Jun 07, 2007 9:27 am     Reply with quote

3.249 (using UltraEdit)

I have code that compiles fine in 3.236 on a desktop w/ PCWH. I'm getting ready to travel and will be using my laptop w/ 3.249 & PCH and UltraEdit.

When I try to compile: (the following code I added to the device header)
Code:
// SSPCON1------------------
extern struct {
unsigned SSPM0:1;
unsigned SSPM1:1;
unsigned SSPM2:1;
unsigned SSPM3:1;
unsigned CKP:1;
unsigned SSPEN:1;
unsigned SSPOV:1;
unsigned WCOL:1;
} SSPCON1;
#byte SSPCON1 = 0xFC6
//------------------------


I get a "EXTERNal symbol not found SSPCON1" error and it points to a line number beyond that of the MAIN file. By commenting lines I've figured that it is a problem with the above code in the header.

I'm I missing something that changed between versions?

Any suggestions would be appreciated.

Thanks,

John
Ttelmah
Guest







PostPosted: Thu Jun 07, 2007 9:38 am     Reply with quote

Extern, _does nothing_ on the older compilers. Support for 'extern', is added in the V4 compiler, and 3.249, _started_to get ready for this.
If you read the manual for 3.236, it will say that the 'extern' keyword, is allowed, but does nothing. In 3.249, is didn't work, but the compiler 'understood' the word enough to kow that it implies an external declaration, which has to be loaded. Hence the error message.
get rid of the extern declaration. It is not needed (you are dealing with a structure that is not 'external' to the program), and is causing your problem.

Best Wishes
jecottrell



Joined: 16 Jan 2005
Posts: 559
Location: Tucson, AZ

View user's profile Send private message

PostPosted: Thu Jun 07, 2007 9:46 am     Reply with quote

Bingo.

Thanks, I would have never figured that one out!

John
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group