Coffee
Joined: 10 Feb 2015 Posts: 9
|
MCU Projects and IMPORT Directive Limitation |
Posted: Wed Apr 15, 2015 9:41 am |
|
|
I’ve come across a limitation of the CCS compiler that is giving me some problems in a Multiple Compilation Unit (MCU) architecture.
I have two files: foo.c and fee.c
I can successfully “link” functions from one file into another file by using the #IMPORT directive.
For example in file foo.c I have the line:
#IMPORT (FILE=fee.o)
The problem I come up against is when I need to go both directions.
In fee.c I add the directive:
#IMPORT (FILE=foo.o)
What happens is the IMPORT in fee.c will have the foo.o which also includes in the fee.o.
I get a duplication errors due to the circular referencing.
Using the ONLY and EXCEPT arguments to the IMPORT directive do not help because I don’t believe that the linker eliminates references to objects – these arguments just manage the inclusion or exclusion of code or addressing. I can’t confirm that but it’s well enough that I know ONLY and EXCEPT do not help with this issue.
I don’t know if there is a work around other than falling back to just using the INCLUDE statement and build everything in one big file -- fee.c + foo.c = fum.c
My Tool Versions are:
PCWH – IDE/Compiler 5.044
CCS Programmer Control Software 5.016
PIC Micros: PIC18F9822 and PIC18F87K22
Regards,
Bill |
|