C itself doesn't have a way to do this; C was created before packages were a common thing.
Note that the ./configure
, make
, make install
system is completely unrelated to C, except that it's often used for programs written in C.
In general, you need to tell the compiler to look in the library for include files, and you need to tell the linker to include the library in the final program. Most build systems do a lot of other things at the same time, but these are the bare essentials. The way to do this depends on the compiler - I see you're using MinGW (a port of GCC).
When you compile the program with GCC, you need to add -I
(that's a capital "i" for "include") followed by the path where it should look for include files. Look around the library for a folder that has include files in it. Say it's at libjpg/include
in the current directory, then you would add -Ilibjpg/include
. (I assume you already know how absolute and relative paths work)
When you link your program (which might be with the same command that compiles it, depending on how you're doing it) you need to use -L
- it works like -I
but for library files (.a
and/or .so
files). You also need to use -l
(lowercase "l" for "library") to tell it to actually use the library. After -l
you put the name of the library, without lib
at the start and without the extension, so if it's libjpg.so
then you'd use the option -ljpg
.
Installing a package will put the include files and library files in the usual locations, so that you don't need to use -I
or -L
. You could do that yourself, if you want, even if the package doesn't actually have an installer. I'm not sure what the "usual locations" are for MinGW.