creating a c library

This is a discussion on creating a c library within the C Programming forums, part of the General Programming Boards category; can anyone help by giving me a webpage where i can find a detailled method of writing a library. thanks ...

  1. #1
    Registered User
    Join Date
    Jan 2007
    Posts
    72

    creating a c library

    can anyone help by giving me a webpage where i can find a detailled method of writing a library. thanks in advance

  2. #2
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,169
    Hard to give detailed information when you give so little detail yourself. How about letting us in on your OS and compiler?

    Have you thought of google?
    If you understand what you're doing, you're not learning anything.

  3. #3
    Registered User
    Join Date
    Jan 2007
    Posts
    72
    yes but there was nothing special

  4. #4
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,249
    Quote Originally Posted by elton_fan View Post
    can anyone help by giving me a webpage where i can find a detailled method of writing a library. thanks in advance
    Typically a library consists of a library module (.lib or .a file) and an associated .h file or group of .h files. There is no substantial difference between writing library code and program code -- a program simply has a main() function where execution starts, and a library does not.

    To create the library, you compile the .c files as you would for a normal program, but instead of linking the resulting object files together into an executable, you package them into a library file. The program that does this is called the archiver.

    Your library distribution will contain this library archive, along with the .h files and documentation. To use the library, the programmer includes the relevant header files and adds your library archive to the link line.

    Any information more specific than that would be platform oriented, and you haven't described what platform you're on.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Makefile for a library
    By sirmoreno in forum Linux Programming
    Replies: 5
    Last Post: 06-04-2006, 04:52 AM
  2. Replies: 19
    Last Post: 01-12-2006, 10:04 AM
  3. very weird .h problem
    By royuco77 in forum C++ Programming
    Replies: 1
    Last Post: 09-11-2005, 07:55 AM
  4. Replies: 4
    Last Post: 11-12-2002, 05:26 AM
  5. Creating extra library
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 03-28-2002, 05:48 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21