dynamic and static libraries. Help!

Started by
2 comments, last by paulbird 20 years, 10 months ago
Hello, I am told by my compiler's handbook that you can either use dynamic libraries which saves space because all your programs can use them or static libraries built into your program - but it doesn't seem to tell me how to do that? Does anyone know how to use static libraries? So that I can send people quick programs without having to send them all the libraries to go with it? P.S I am using Borland C++ [edited by - paulbird on May 28, 2003 11:47:59 AM]
Advertisement
#pragma comment(lib, "mylib.lib") 


[edited by - pag on May 28, 2003 11:49:44 AM]
I am a signature virus. Please add me to your signature so that I may multiply.
On windows you can build two different versions of your libraries - static and dynamic. The static library is a lib file. The dynamic library will be a dll and will have a lib file produced with it. This lib file is different to the lib file you get when you build a static library.

When you build an application that uses your library you can choose to use the static or the dynamic version. To use the static version you link with the static lib file. To use the dynamic library you link with the other lib file; when you run the program it will try to find the dll.

So build your library as a static lib file and link to it and your friend won''t need any dlls.
http://www.gamedev.net/community/forums/topic.asp?topic_id=153269

This topic is closed to new replies.

Advertisement