View previous topic :: View next topic |
Author |
Message |
ckuecker
Joined: 15 Mar 2011 Posts: 3 Location: Beloit, WI USA
|
Problems porting code from Keil C51 |
Posted: Thu Mar 17, 2011 12:08 pm |
|
|
Hello,
I have working code from an 8051 project that I need to port over to a PIC8=18F87J72 processor. I figured out some of the issues already, but on compiling under CCS, I am seeing many errors like this:
In the .h file:
Code: |
116 extern unsigned int16 sleep_timeout; // Master delay time (seconds)
117 extern unsigned int16 sleep_count; // Sleep / discover transmit count
118 extern unsigned int16 flash; // LED flasher timer
119 extern unsigned int16 bat_time; // Battery check timer
*** Error 38 "C:\Code\xbee.h" Line 117(34,35): This type can not be qualified with this qualifier
*** Error 43 "C:\Code\xbee.h" Line 117(34,35): Expecting a declaration
*** Error 38 "C:\Code\xbee.h" Line 119(31,32): This type can not be qualified with this qualifier
*** Error 43 "C:\Code\xbee.h" Line 119(31,32): Expecting a declaration |
Declarations in the .c file:
Code: |
unsigned int16 sleep_count; // Sleep / discover transmit count
unsigned int16 xlength; // Reply string length
unsigned int16 flash; // LED flash timer
unsigned int16 bat_time; // Battery check timer |
I don't see the error. 'extern', 'unsigned', and 'int16 are all good types in CCS C as far as I can see.
Any ideas? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
ckuecker
Joined: 15 Mar 2011 Posts: 3 Location: Beloit, WI USA
|
|
Posted: Thu Mar 17, 2011 3:11 pm |
|
|
Did some digging in the CCS manual. "Multiple Compilation Units" gives an example of how to run the command line compiler as a linker, after including the +EXPORT option on each compiler invocation.
I'm going to look into getting that to happen through MPLAB, which I want to continue using for ease of debugging. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
ckuecker
Joined: 15 Mar 2011 Posts: 3 Location: Beloit, WI USA
|
|
Posted: Thu Mar 17, 2011 3:48 pm |
|
|
I'm screwed. I bought the PCH compiler, not the PCW or IDE versions, and that FAQ specifically says I can't do it with this program.
I really wish that limitation had been explicitly called out in the description of the product. Unless I can upgrade this copy, I've wasted $200. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Mar 17, 2011 3:56 pm |
|
|
You still compile the files by using the conventional CCS method:
http://www.ccsinfo.com/forum/viewtopic.php?t=18649&start=1
Only the main source file for the project is "added" to the Source Files
list in the MPLAB project window. All other files are added to the project
with an #include line in the main source file.
If you have source files for each file (and not just object files), then you
can do it this way. However, you will have to edit the files and get rid of
the 'extern' keywords, etc. |
|
|
|