Hi, I have created some functions and I need to create a library for a client. I don't want him to have my source. So how can I create such thing ? Thanks, Oprah,
Use the LIBx51 librarian tool. See Chapter 10 in the Assembler/Utilities manual. If there are few functions, you might just give them the one object file. A library is essentially just a collection of a bunch of object files, with a header so that the linker can find them. Or, you can just put the .obj into a .lib.
Errm... check the 'Create a Library' box in the uVision options...?
"you might just give them the one object file. A library is essentially just a collection of a bunch of object files" True. The potential advantage of a true Library is that the Linker may be able to include only those parts that are actually used by the customer's application. I say "potential" because this does rely on you structuring your library properly - see the Manual "...a header so that the linker can find them..." No. Header files have absolutely nothing whatsoever to do with the Linker; they simply provide information to the Compiler. See this thread: http://www.keil.com/forum/docs/thread4887.asp
"...a header so that the linker can find them..." "No. Header files have absolutely nothing whatsoever to do with the Linker; they simply provide information to the Compiler." Try reading a bit more carefully before you shout.
That is not to say that you don't need a header file; just to emphasise that a header file does not tell the Linker anything at all. The header file is required by the Compiler - not the Linker.
"Try reading a bit more carefully before you shout." Oops - now I see it: you mean a Library file contains some header information whereby the Linker can identify the individual components. I was off on a tangent talking about 'C' header files that are usually supplied with Libraries to tell the Compiler about the Library contents. Very sorry - I had the end of the wrong stick. Just like the two old ladies shouting across the street - they could never reach an agreement, because they were arguing from different premises!
Oprah Winfrey, Are you talking about a library of your books of the month? Erik Why do some find it amusing to hide thbeir identity behind ridiculous monnikers?
Maybe Opera has a new sideline
"...a header so that the linker can find them..." Sorry for the confusion. I do not mean a header in the sense of a C language .h file. I mean a header in the sense of structured information available at the beginning of a file (or packet, or whatever) which describes the following information. A library file often has a really simple structure that looks something like: header: (obj file1, offset) (obj file2, offset) (obj file3, offset) body: file1 file2 file3 This is an archive file that simply contains other files along with an index of where to find them, kind of like a .ZIP file without compression. You can add lots of extra features and refinements, of course. As far as I know, the Keil implementation includes all of the contents of an obj file if any item is referenced. The linker will omit totally unneeded .objs, which at least is a step up from handing uVision a list of .obj files, which will all be included in the project even if not needed.