Thread: how do i add my own library funtions??

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

    how do i add my own library funtions??

    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
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Welcome to the forums!

    How old are you? Turbo C 2.01 had its 16th birthday this year. Are you younger than it by any chance? If you have an 8086 and are running DOS 1.0 you have an excuse for running TurboC. Otherwise, get a compiler that has been updated since the fall of the Roman empire. Try Dev-C++. If you still wan't technical help with an antique, you'll need to invent a time machine.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    > 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.
    This is extremely bad advice. One update to your compiler and boom all your work has been lost.

    > i am using tc201 compiler.
    Your compiler is from the stone age.
    I'll take a guess that your OS is XP.
    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.

  4. #4
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    I have added my own functions to a header file, not a library file.

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