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,
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,
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).
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.