I don't know C, but need to interact with some C files in a project. I'm noticing that some files have .lib
extension, while others (which are also supposed to be libraries) have .c
and .h
files only in a big folder.
.c
and .h
folders also libraries. .lib
format the official format for libraries and these guys who did .c
and .h
just lazy or not using best practice?.c
and .h
files are source code, i.e., text files. In order to "use" them (i.e., execute the code on a computer) you need to compile them into...
a .lib
file is the end result, i.e., a binary file. It can be statically lined into another executable and the code run on a computer. This saves you the time of compiling the source if you don't need to.
.lib
is just one common extension, but it doesn't really matter what the extension is as long as the file is valid. Point your compiler/linker to the .whatever
library file and let 'er rip, it will all work out in the end.
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