Thread: how to add my own funtion into a library

  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    2

    Post how to add my own funtion into a library

    hi there ,
    my name is nitin, i am quite new to programming and just started of with c programing.
    i was doing some programs on recursive functions when i came across the part where
    it said the i could reduce the compilation time of my program if i added my own function
    to an already existing library such as math.lib.
    i am using tc201 compiler.
    this is what i had done
    1,i made a function definition of my function i wanted to add in a file of .c extention,.
    2.compiled the file ,it creats FILENAME.OBJ file.
    3.add function to the library c:\>tlib math.lib+c:\FILENAME.obj
    4.declared its prototype in a FILENAME.H file.
    5.wrote a program to use the function ,#included the FILENAME.H as the url in double quotes.

    now to the problem. when i compiled it gave me no error. but when i tried to run it gave me a linker error.

    does this mean that my function that i tried to add didn't get added to the lib ??
    please help.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Library program - need some help
    By Guti14 in forum C Programming
    Replies: 4
    Last Post: 09-08-2004, 12:09 PM
  2. VC++6.0 Add member function Wizard
    By 7stud in forum C++ Programming
    Replies: 5
    Last Post: 04-05-2003, 08:48 PM
  3. Replies: 4
    Last Post: 11-12-2002, 06:26 AM
  4. Add and delete functions
    By Ana Val sazi in forum C++ Programming
    Replies: 5
    Last Post: 06-18-2002, 09:59 PM