A library can be used in an application in two ways:
- Statically stitched
- Dynamically linked
But how to do this using both Visual Studio (Windows) and GCC?
I know that libraries are distributed only in these 4 ways:
- Source
- headers only libraries
- *. lib files for windows. * .a for linux
- *. dll (windows) and * .so (linux).
Source distribution just compiles. "Header-only libraries" is nothing more than the source distribution.
Now, if the desired library is distributed in the form *. lib . To use it.
In Visual Stuido :
- , (*. h), > >
- *.lib Configuration Properties > Linker > Input > Additional Dependencies
- *.lib : > p >
GCC/MingW?
, , *.dll *.so . - , Visual Studio (Windows) GCC (linux)/mingw (windows)