View previous topic :: View next topic |
Author |
Message |
carl
Joined: 06 Feb 2008 Posts: 240 Location: Chester
|
New Compiler Issues |
Posted: Thu May 23, 2013 7:28 am |
|
|
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
|
|
Posted: Thu May 23, 2013 8:18 am |
|
|
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
|
|
Posted: Thu May 23, 2013 8:44 am |
|
|
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
|
|
Posted: Thu May 23, 2013 9:28 am |
|
|
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
|
|
Posted: Thu May 23, 2013 12:03 pm |
|
|
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
|
|
Posted: Thu May 23, 2013 1:40 pm |
|
|
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: 19559
|
|
Posted: Thu May 23, 2013 2:23 pm |
|
|
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
|
|
Posted: Thu May 23, 2013 2:31 pm |
|
|
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
|
|
Posted: Thu May 23, 2013 3:27 pm |
|
|
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)
|
|
|
carl
Joined: 06 Feb 2008 Posts: 240 Location: Chester
|
|
Posted: Thu May 23, 2013 3:40 pm |
|
|
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
|
|
Posted: Fri May 24, 2013 3:41 am |
|
|
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 |
|
|
|