A library can be used in an application in two ways:
- Statically-linked
- Dynamically-linked
But how to do that using both Visual Studio (windows) & GCC?
I know libraries are distributed only in these 4 ways:
- Source
- header-only libraries
- *.lib files for windows. *.a for linux
- *.dll (windows) & *.so (linux).
Source distribution is just compiled."header-only libraries" are nothing but a source distribution.
Now if the desired library is distributed in *.lib form. Inorder to use it.
On Visual Stuido :
- We add directory path containing headers(*.h) to Configuration Properties > General > Additional Include Directories
- we add each *.lib file to Configuration Properties > Linker > Input > Additional Dependencies
- we add directory path of *.lib files to: Configuration Properties > Linker > Additional Library Directories
How to do the same thing for GCC/MingW? I don't know how to build my application when the library is distributed as *.dll or *.so too. Can someone tell me what do I need to do in these situations for both Visual studio (windows) and GCC(linux)/mingw(windows)