Making "lib" files

This is a discussion on Making "lib" files within the C++ Programming forums, part of the General Programming Boards category; Hi my friends, I want to know how I can make a ?lib? file (e.g. ?mylibrary.lib?) and how use it ...

  1. #1
    Registered User
    Join Date
    Sep 2004
    Posts
    4

    Question Making "lib" files

    Hi my friends,
    I want to know how I can make a ?lib? file (e.g. ?mylibrary.lib?) and how use it in my programs.
    Thanks,

  2. #2
    Registered User lobo's Avatar
    Join Date
    Oct 2001
    Posts
    71
    Check your compiler's documentation - there usually is a switch or choice specifying what exactly do you want it to output - executable, lib, dll, whatever, depending on platform and other things.
    Once you have .lib file, you should have header file for it's content as well. Then you use that header in your code. And when building, you must tell your linker to use your lib file during linking (again, check documentation to see how to do that).

  3. #3
    Registered User
    Join Date
    Aug 2003
    Posts
    470
    Using msvc++, you can create both static and dynamic libraries. When creating a new project, choose between creating a static library and a dynamic library. And you should go from there, but I've found that mixing up C multithreading libraries with C singlethreading libraries can make for a confusing mess of linker errors, at least with static libraries.

    If you choose to create a dynamic library, you have to add special import and export tags to the functions or create a .def file manually. More details may be found at www.flounder.com and your compiler's help files.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Multiple Cpp Files
    By w4ck0z in forum C++ Programming
    Replies: 5
    Last Post: 11-14-2005, 01:41 PM
  2. I Need To Know Some Things That I Can Put Into A Batch File
    By TheRealNapster in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 10-20-2003, 08:12 PM
  3. reinserting htm files into chm help files
    By verb in forum Windows Programming
    Replies: 0
    Last Post: 02-15-2002, 08:35 AM
  4. making files unrecoverable
    By *ClownPimp* in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 02-13-2002, 06:29 AM
  5. Making MIDI files.... HOW??!!
    By sean in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 11-08-2001, 04:46 PM

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