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

MCU Projects and IMPORT Directive Limitation

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



Joined: 10 Feb 2015
Posts: 9

View user's profile Send private message

MCU Projects and IMPORT Directive Limitation
PostPosted: Wed Apr 15, 2015 9:41 am     Reply with quote

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
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