Finding libraries using pkg-config on Windows

I am trying to find gstreamer lib in windows (msvc) using pkg-config

pkg-config gstreamer-0.10 --cflags -libs

but I get a result like this

Package gstreamer-0.10 was not found in the pkg-config search path. Perhaps you should add the directory containing `gstreamer-0.10.pc' to the PKG_CONFIG_PATH environment variable No package 'gstreamer-0.10' found 

a.pc, as created when the library is installed (automatically using RPM, deb, or another binary packaging system, or by compiling from source). I can not find the .pc file in my gstreamer directory.

Should I just create a .pc file with all the necessary data.

 prefix=C:\Program Files (x86)\OSSBuild\GStreamer\v0.10.7 exec_prefix=${prefix} libdir=${exec_prefix}\lib includedir=${prefix}\sdk\include\gstreamer-0.10 toolsdir=${exec_prefix}\bin pluginsdir=${exec_prefix}\lib\gstreamer-0.10 datarootdir=${prefix}\share datadir=${datarootdir} girdir=${datadir}/gir-1.0 typelibdir=${libdir}/girepository-1.0 Name: GStreamer Description: Streaming media framework Requires: glib-2.0, gobject-2.0, gmodule-no-export-2.0, gthread-2.0, libxml-2.0 Version: 0.10.35 Libs: -L${libdir} -lgstreamer-0.10 Cflags: -I${includedir} 

or is there any other way to do this, or am i missing something?

I hope you can help. Thanks for taking the time to read the issue.

Well, I do this to find a solution to why I get a not found message in my waf setup for gstreamer

 conf.check_cfg(atleast_pkgconfig_version='0.0.0') conf.check_cfg(package='gstreamer-0.10', uselib_store='GSTREAMER', args='--cflags --libs', mandatory=True) 

The code works on Linux and should work on windows as well.


ADD AFTER

Well, doing .pc and setting the .pc-dir path to the PKG_CONFIG_PATH environment variable does the trick. Not hard to do it

Check this one . Thanks for reading and helping me .. :)

+5
source share
1 answer

pkg-config is a great tool, but unfortunately there is no standard PATH or PKG_CONFIG_PATH executable on Windows (compared to UNIX).

For now, you can go back to defining the parameters --with-gstreamer-include-dir ... --with-gstreamer-lib-dir ... and avoid the pkg-config dependency, you can also use -pkgconfig- exe c: \ path \ to \ pkg-config.exe --pkgconfig-path c: \ path \ to \ gstreamer; c: \ path \ to \ otherlib, which will help to have beautiful wscript, especially when using a lot of pkg-config libs.

A typical Win32 user may have problems setting PKG_CONFIG_PATH and PATH directly, or stumble upon a mysterious "not found" error, and then check config.log.

If you add the pkg-config options for Windows, this may be of interest to everyone. You can write the pkgconfig_opts tool and send it as an additional file.

+2
source

Source: https://habr.com/ru/post/959272/


All Articles