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

New Compiler Issues

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



Joined: 06 Feb 2008
Posts: 240
Location: Chester

View user's profile Send private message

New Compiler Issues
PostPosted: Thu May 23, 2013 7:28 am     Reply with quote

Hi All,

I have finally managed to buy the newest version of CCS Software -PCWHD V5.003. This is the first time I have ever done this.

My old version is PCWH 4.038.

So I have made sure that the new software has been saved and installed in a different folder - so that 'ALL' my old programs can still be run using the old compiler.

However, I made a new MPLAB project with exactly the same source files/code as an ongoing project - and tried it with the new compiler - and unfortunately it came up with a few errors which seem to be centered around where I have used the 'EXTERN' command. Info below
Code:
int32 send_min (void);


extern unsigned int32 ival2 = 0;
int8 flag = 6,loop;

int32 load_min(void){


and the errors are:
Code:
Clean: Deleting intermediary and output files.
Clean Warning: File "C:\Documents and Settings\RandD\Desktop\MASTER\master.o" doesn't exist.
Clean: Deleted file "C:\Documents and Settings\RandD\Desktop\MASTER\master.ERR".
Clean: Done.
Executing: "C:\PIC - Newest Version\PICC\Ccsc.exe" +FH "master.c" +DF +LN +T +A +M +Z +Y=9 +EA  #__18F8520=TRUE
*** Error 36 "C:\Documents and Settings\RandD\Desktop\MASTER\load_min.c" Line 15(23,28): Expecting a ; or ,
*** Error 43 "C:\Documents and Settings\RandD\Desktop\MASTER\load_min.c" Line 15(31,32): Expecting a declaration
*** Error 43 "C:\Documents and Settings\RandD\Desktop\MASTER\load_min.c" Line 15(32,33): Expecting a declaration
*** Error 36 "C:\Documents and Settings\RandD\Desktop\MASTER\load_max.c" Line 13(23,28): Expecting a ; or ,
*** Error 43 "C:\Documents and Settings\RandD\Desktop\MASTER\load_max.c" Line 13(31,32): Expecting a declaration
*** Error 43 "C:\Documents and Settings\RandD\Desktop\MASTER\load_max.c" Line 13(32,33): Expecting a declaration
      6 Errors,  0 Warnings.
Build Failed.
Halting build on first failure as requested.
BUILD FAILED: Thu May 23 13:51:07 2013


I assume there will be lots of differences and issues when trying to use the same program with different compilers. Can anyone comment on why the errors seem to be pointing to the 'EXTERN' command.

Thanks
Carl
carl



Joined: 06 Feb 2008
Posts: 240
Location: Chester

View user's profile Send private message

PostPosted: Thu May 23, 2013 8:18 am     Reply with quote

hmmmm!!!

If I declare the variables as local (inside a program routine), thenit compiles without errors - like this:
Code:
int32 load_max(void){

extern unsigned int32 ival3;
int8 flag2 = 6, loop2;
ival3 = 0;


but if they are declared as globals (outside a program, at the top of a .c file) then errors are introduced when I compile - like this:
Code:
extern unsigned int32 ival3;
int8 flag2 = 6, loop2;
ival3 = 0;

int32 load_max(void){


am I doing something wrong here?
the fact remains though that it works with teh old compiler and not the new compiler?

Thanks
Carl
ezflyr



Joined: 25 Oct 2010
Posts: 1019
Location: Tewksbury, MA

View user's profile Send private message

PostPosted: Thu May 23, 2013 8:44 am     Reply with quote

Hi Carl,

Without even looking at your code, I'd like to mention that the 'Version 5' CCS compiler is still a Beta version. Unless you need the new features or device support of the v5 compiler, I'd suggest you get the current v4 compiler (v1.141) at: http://www.ccsinfo.com/downloads.php

John
carl



Joined: 06 Feb 2008
Posts: 240
Location: Chester

View user's profile Send private message

PostPosted: Thu May 23, 2013 9:28 am     Reply with quote

Hi Ezflyr,

Thanks for the info - i did as you suggested.
I now have another compiler - V4.141.

No change on the error though it is still the same as previous response.
So 5.003 gives an error.
and V4.141 gives an error.
But my oldest version compiles without error.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu May 23, 2013 12:03 pm     Reply with quote

According to the CCS manual 'extern' is used when compiling with the
CCS IDE in Multiple Compilation Units mode. Are you doing that, or
are you compiling in the normal CCS "one big file" mode ?

From the CCS manual, in the section on Basic and Special types:
Quote:

extern -

External variable used with multiple compilation units. No storage is
allocated. Is used to make otherwise out of scope data accessible. There
must be a non-extern definition at the global level in some compilation unit.
carl



Joined: 06 Feb 2008
Posts: 240
Location: Chester

View user's profile Send private message

PostPosted: Thu May 23, 2013 1:40 pm     Reply with quote

Hi pcm,

The first option. I have several .c files all linked into the same project. I use it regularly to ensure that a variable can be used and changed between the various .c programs.

I do not generally just do one big .c file. I thought it was good practice and programming to break the program up into smaller chunks - easier for de-bugging.

Carl
Ttelmah



Joined: 11 Mar 2010
Posts: 19513

View user's profile Send private message

PostPosted: Thu May 23, 2013 2:23 pm     Reply with quote

Have you recompiled these other files first.
The link format did change at some point in the last few versions. I'd guess it is trying to link files in the old format, and hence it is not working.

Best Wishes
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu May 23, 2013 2:31 pm     Reply with quote

By "one big file" I actually meant using #include in your main file to
incorporate several .c and .h files. I didn't mean one big continuous file.
I don't have the CCS IDE so I have to do projects that way.
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Thu May 23, 2013 3:27 pm     Reply with quote

though i have tested a lot, and had a lot of success,
there are FAR bigger fish to fry in terms of Vars in 5.003

like say the int64 and int48 types, well,
actually being accepted by the command line compiler.

they only exist in the pop up doc window so far ( yes,been reported)
Sad Sad Sad Sad
carl



Joined: 06 Feb 2008
Posts: 240
Location: Chester

View user's profile Send private message

PostPosted: Thu May 23, 2013 3:40 pm     Reply with quote

Pcm - yes i have lots of #includes in the main.c file.

Ttelmah - good thinking! The other .c files might still be compiling using the old version. I will try each one individually - and see tomorrow.

Thanks
carl



Joined: 06 Feb 2008
Posts: 240
Location: Chester

View user's profile Send private message

PostPosted: Fri May 24, 2013 3:41 am     Reply with quote

Ttelmah,

Got a bit confused about the plan of action.
I can't individually compile the different .c files - because obviously they are only linked files to the main.c file. In other words the dont have all the pre-processor and #include declarations - because these are only in main.

I will keep looking at it

Carl
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