How to write * .pc files for pkg-config on Windows?

I recently downloaded the gtk + all-in-one package downloaded from the GTK + website , which works great and allows me to create gtk + applications on Windows using the MinGW compiler.

However, when we look at the * .pc files for pkg-config in lib / pkgconfig, I noticed something strange. Here's what the beginning of glib-2.0 looks like:

prefix=c:/devel/target/059c48de6b739307c37648aba3005b29
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

My gtk + folder is on a different drive than C: \, and I don’t have a C: \ devel folder at all. So what does this prefix mean? What prefix would I use if I decided to write a * .pc file to easily link my own application?

Surprisingly, using pkg-config works as expected and returns the correct library and header path inside the gtk + folder.

+5
source share
1 answer

The version of pkg-config that comes with all in the same package basically ignores the prefix. He knows what to look in the .. / lib / pkgconfig file for the pkg-config files. You do not need to do anything special for your pkgconfig files, except to put them in the pkgconfig directory, or set some environment variables, so pkg-config knows where to look for your * .pc files.

+2
source

All Articles