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

C library code

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



Joined: 09 Dec 2009
Posts: 37

View user's profile Send private message

C library code
PostPosted: Tue Mar 12, 2013 3:02 am     Reply with quote

Hello all
Is it possible to create a C library code, so we can use the functions in it, but we cant let someone else see the source of the code.
Is that possible with ccs ?

Regards
Ttelmah



Joined: 11 Mar 2010
Posts: 19537

View user's profile Send private message

PostPosted: Tue Mar 12, 2013 3:58 am     Reply with quote

Yes. This is what linking is about.
You'd generate a set of routines, compile these to a linkable OBJ (.o) module, with the functions 'exported', then in you main program define these routines as 'external' and import these and link the module. The main code only has to know that the functions exist, what they are called, and what their 'calling convention' is, not the details of the code.
It is not (at heart), how CCS is normally used, but it does now support this.
How to do it, depends on whether you are using the IDE, or command line. On the command line, the link has to be added to the commands you use. On the IDE, the 'multiple compilation units' tick box in the Project Options, and 'Link separately' allows this.
Look at 'linker overview' in the manual. There is also an example 'mcu.zip', included in the examples directory.

Best Wishes
temtronic



Joined: 01 Jul 2010
Posts: 9241
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Mar 12, 2013 5:46 am     Reply with quote

also...
be sure to 'protect' the PIC code from being read by the other person.
It ain't rocket science to 'reverse engineer' the program from within the PIC.

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