This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How do you create a library ?

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,

Parents
  • 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.

Reply
  • 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.

Children
  • "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!