Thread: how to create a library

  1. #1
    Registered User
    Join Date
    May 2003

    Angry how to create a library

    I need general details on how to set-up my function in a header file so that it could be called from anybodys program just by '# include <myheader.h>.
    Function name: myfunction(char cookie)

    #include <myheader.h>

    cookie = myfunction(char cookie);

    I'm fairly new to setting up header file to include my own function and I would appreciate some detailed informaton on how to go about setting it up.
    I'm using c++ compiler and I can't see any help file associated with header or library files.

    Any help would be appreciated.

    Thanks in advance,
    Naresh Nijran

  2. #2
    Join Date
    Nov 2002
    I had this same question recently, here is a really really good explanation of how to organize the contents of your library. There are other ways to do it but I thought that was pretty neat.

    Btw the < > around the library name means that the compiler will look in the spot where your system header files are located, i think thats usually a few different places. The " " around the name means that it will look in the cwd first then the system header file location. I had a really good link to a howto for linux on how to make all kinds of libraries but I can't find it heh. Goodluck.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Programming library with built in manager
    By cyreon in forum C Programming
    Replies: 5
    Last Post: 06-26-2009, 12:49 PM
  2. What's an import library?
    By chiefmonkey in forum C++ Programming
    Replies: 1
    Last Post: 06-19-2009, 05:00 PM
  3. standrad library
    By sarahr202 in forum C++ Programming
    Replies: 11
    Last Post: 05-18-2009, 08:50 PM
  4. create a static library from C++ and C code
    By lehe in forum C++ Programming
    Replies: 1
    Last Post: 04-06-2009, 07:28 PM
  5. Create a user library
    By mabuhay in forum C Programming
    Replies: 8
    Last Post: 11-03-2005, 03:42 PM