|
|
View previous topic :: View next topic |
Author |
Message |
vsmguy
Joined: 13 Jan 2007 Posts: 91
|
Creating libraries using CCS C |
Posted: Sat Feb 10, 2007 10:20 am |
|
|
Is it possible to create custom libraries in CCS C, just like custom vendor libraries in standard C?
Or do we have to give out the source code and ask the user to create a project and link the code together ?
How does CCS handle this - do they ship the complete code to all their routines ? That does not make much commercial sense !(I am too lazy to check that out myself, but the LST files do leave out blocks of code...) |
|
|
Guest
|
|
Posted: Sat Feb 10, 2007 2:50 pm |
|
|
If you're too lazy to look for yourself, then I'm too lazy to answer.
However, should you look at the ...\drivers directory of your CCS installation and open one of the 'C' standard headers, all will be revealed. |
|
|
Ttelmah Guest
|
|
Posted: Sat Feb 10, 2007 4:03 pm |
|
|
I think the replier here, needs to learn how libraries work....
The original question is not a matter of looking in the directories.
As currently 'working properly', the answer is no. At present, CCS, does not (yet) support/use a linker, and so does not support libraries. However it is promised, and _very close_. A few versions ago, it didn't work at all. The last time I tried, it nearly worked, and I haven't tested the latest couple of V4 compilers for this, so it may be working now.
However there is an alternative. CCS, supports shipping include files, in an encrypted form, allowing these to be shipped without giving away the code.
Probably 90% of users here, either don't ship sources at all, or if they do, ship everything.
Best Wishes |
|
|
vsmguy
Joined: 13 Jan 2007 Posts: 91
|
|
Posted: Sun Feb 11, 2007 7:36 am |
|
|
Ttelmah
It's better not to comment on guest postings, specially snobbish ones like these. Your time is much more valuable. I ignore such messages by principle.
Yes, I noticed that CCS does not have support for a linker... they just have a compiler which does all the source (C/C++) to hex all in one go. In one step.
I also don't support the idea if having live code in headers, and that's what CCS is currently doing in most cases, but from what I read in the forum, 4.x is turning things around...
As an offtopic question, is there any PIC C Compiler which lets one do so ? From all the searching I did, I don't think so, but you will know better.
However, I would be very interested in "shipping include files, in an encrypted form"... this is a very nice temporary solution. Until they work out the linker that is.
Is it possible to do it out of the box ? Have you ever done it ?
Shipping the code completely is not a problem - only thing - the licensing becomes more of paper work and NDAs.. and you will not believe.. most even don't care about the code being there ! |
|
|
jma_1
Joined: 08 Feb 2005 Posts: 147 Location: Wisconsin
|
|
Posted: Sun Feb 11, 2007 10:19 am |
|
|
Greetings,
I have not yet tried out the SDCC compiler, but it is a targetable compiler (Z80, 8051, PIC, etc). Perhaps it has the library feature you are looking for.
The compiler is open source and provides some documentation. I saw an article in the Circuit Cellar magazine which used the SDCC for a project.
http://sdcc.sourceforge.net/
The PIC-C compiler from HITECH might be another alternative, but it is much more costly.
Personally, I do not like using products which do not give the source code access for system libraries. I've found many problems with libraries which I cannot fix myself or worse yet, have to spend time re-creating the same functionality with my own libraries. The responsiveness of the group providing the system libraries is not always very good.
Cheers,
JMA |
|
|
Guest
|
|
Posted: Sun Feb 11, 2007 12:35 pm |
|
|
My response:
Quote: | If you're too lazy to look for yourself, then I'm too lazy to answer.
However, should you look at the ...\drivers directory of your CCS installation and open one of the 'C' standard headers, all will be revealed.
|
was a specific answer to the last part of the original question:
Quote: | How does CCS handle this - do they ship the complete code to all their routines ? That does not make much commercial sense !(I am too lazy to check that out myself, but the LST files do leave out blocks of code...) |
|
|
|
Ttelmah Guest
|
|
Posted: Sun Feb 11, 2007 4:21 pm |
|
|
If you have the Windows version of the compiler, you open a file, and select from the file menu 'encrypt'. It generates a file with an 'encrypted' extension.You then #include this as if it was the normal file.
Yes, it works.
Simple commercial need, makes this, or a library necessary. At the end of the day, if you spend time writing a function, and you want to distribute this, unless you can trust everybody, something like this has to be used.
It actually can be better for code reliability. Allowing sections to be properly removed from fiddling fingers!...
Best Wishes |
|
|
|
|
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
|