Thread: I want to make a *.lib for my header file

  1. #1
    Registered User
    Join Date
    May 2002
    Posts
    63

    Question I want to make a *.lib for my header file

    Does anybody have any suggestions on how to make a .lib file for a header file which I created for my program.

    Please help.
    Thanks
    Tyrone Tudehope

  2. #2
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    So you have a header file and you want the implementation to be in a library file? What compiler are you using? If you are using VC++ it is very easy. Under New just find project and then static linked library. It's really not that difficult. Do you know how to include the library in your project once it's been created?

  3. #3
    Registered User
    Join Date
    May 2002
    Posts
    63
    I am using Borland 5.5
    I unfortunately don't know how to include a library in my project.
    If you dont mind taking the time to help, I will really appreciate it.
    Thanks

  4. #4
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    Originally posted by tudehopet
    I am using Borland 5.5
    I unfortunately don't know how to include a library in my project.
    If you dont mind taking the time to help, I will really appreciate it.
    Thanks
    I am always glad to share whatever knowledge I may have with others. Unfortunately I am not that familiar with Borland 5.5. If no one else has helped you by tomorrow I will download the compiler and experiment with it. Usually in the compiler there are project settings and linker options where you choose which lib's get linked with your project. Again, I will research Borland 5.5 and get back to you tomorrow if no one else has already answered your question.

  5. #5
    Registered User
    Join Date
    May 2002
    Posts
    63
    Thanks for your help
    I will also see what I can do in regards to experimenting with it.

  6. #6
    Registered User
    Join Date
    May 2002
    Posts
    63

    Lightbulb

    I have just figured out how to do it.

    This is for anyone who wants to know:
    - you include your header file like normal
    - then you don't put any other functions in your *.cpp program
    - you compile then you will more than likely get an error after compiled it
    - but this is fine, now type tlib "file name" enter.
    - now edit the header file and take away the definitions and leave the declarations (if any).
    - now add the 'int main()' and what ever you want in your program and then compile it.
    - it should run as you wanted it to run.

    I will post any example later
    *Note: This is for borland 5.5 & commandlinetools.
    I don't know if it will work on lower versions, I haven't tried yet.

  7. #7
    Registered User
    Join Date
    May 2002
    Posts
    63
    Sorry I made a mistake

    Borland spits out an error after it compiles
    Something about external functions not there

    Please help!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. File transfer- the file sometimes not full transferred
    By shu_fei86 in forum C# Programming
    Replies: 13
    Last Post: 03-13-2009, 12:44 PM
  2. Need help understanding Header Files
    By Kaidao in forum C++ Programming
    Replies: 11
    Last Post: 03-25-2008, 10:02 AM
  3. archive format
    By Nor in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 08-05-2003, 07:01 PM
  4. Making a LIB file from a DEF file for a DLL
    By JMPACS in forum C++ Programming
    Replies: 0
    Last Post: 08-02-2003, 08:19 PM