Is C standard library function(ex.prinf, scanf) treated as static library function or dynamic library function?
It's specific to the version of the compiler used. This library is always statically linked, even when using a dynamically linked UCRT.
What are the differences between static and dynamic libraries? Static libraries, while reusable in multiple programs, are locked into a program at compile time. Dynamic, or shared libraries, on the other hand, exist as separate files outside of the executable file.
A static library must be linked into the final executable; it becomes part of the executable and follows it wherever it goes. A dynamic library is loaded every time the executable is executed and remains separate from the executable as a DLL file.
But in pure C, with no extensions, and the standard library functions removed, you basically can't do anything other than read the command line arguments, do some work, and return a status code from main .
it depends on how you link your program. you can go both ways. On VS, you can specify either /MT
(static) or /MD
(dynamic). On gcc, you can specify -static-libgcc
flag to link your program against the static library.
Refer to http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html for more info on gcc flags and http://msdn.microsoft.com/en-us/library/abx4dbyh(v=vs.80).aspx for VS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With