Tell pkg-config where to find packages on windows - windows

I want to use the Haskell ffmpeg library under windows so I tried to install it via cabal.
After downloading and extracting ffmpeg shared (64bit) version to C:\FFmpeg cabal complained that pkg-config was not installed.
I downloaded it and moved it to the bin folder of MinGw. Now cabal complains that it can not find the pkg-config package libavutil.
First part of the question:
What is a pkg-config package? Is it just the dll that comes with the shared version of ffmpeg?
Second part:
I know pkg-config uses .pc files to describe where to look for packages and it uses the PKG_CONFIG_PATH variable to find .pc files. So how would a .pc file look when the libavutil dll is located in C:\FFmpeg\bin?
PS: The dll in FFmpeg\bin is named avutil-55.dll
Thanks

Related

Where is libzmq header file?

I compiled and installed libzmq on my Raspberry pi but I can't find the C-binding header file, czmq.h.
I searched the entire file system and only find the libary files in /usr/local/lib.
https://linux.die.net/man/7/czmq
You have to install czmq also, it's a separate library and it is not included with libzmq: http://czmq.zeromq.org

PoDoFo installation in Ubuntu(Linux)

I compile and installed PoDoFo in Ubuntu. But /usr/include and /usr/lib doesn't have any entry. I need it to work with my programs. Could you please let me know by default where the header file and lib files are installed? And how I can installed them in /usr/include and /usr/lib?

Octave configure cannot find Qt library on OS X

I have installed QT 4.8 library on my OS X through direct install with .dmg file downloaded from qt-project.org. It seems a framework version. And so far, a lot of tools recognises it well. But when I am building octave on this computer, it gives a warning of "Qt libraries not found". I wonder why. And what can I do to make it recognise the qt lib on my machine.
The command I used for configure is
./configure --prefix=/usr/local --enable-shared F77=gfortran-4.2 LDFLAGS='-L/usr/local/lib'
(further information)
I did tried to find the installation of QT with
find find /Library/ -name QtGui
Returning result being
/Library//Frameworks/QtGui.framework/QtGui
/Library//Frameworks/QtGui.framework/Versions/4/Headers/QtGui
/Library//Frameworks/QtGui.framework/Versions/4/QtGui
Along with the fact that ipython notebook --matplotlib=qt is working well on my system, I assume my Qt Library is successfully installed.
But when performing the check with pkg-config, both pkg-config --cflag QtGui and pkg-config --libs QtGui return no positive result.
Make sure your Qt installation is working. I'll assume it was correctly installed and is visible to the operating system you're using.
The configure command you have pasted accepts two environment variables, QT_CFLAGS and QT_LIBS. Use the pkg-config tool to determine their appropriate values:
pkg-config --cflags QtGui
pkg-config --libs QtGui
and add this information to the command line:
./configure QT_CFLAGS='foo' QT_LIBS='bar' # other stuff...
I think I know the answer now. qt-4.8 installed through .dmg file is a framework version. There is no Qt*.pc file, thus is not able to be found by pkg-config. So, in order to use pkg-config to find qt installed in the system, you need to build qt from source(source downloadable from qt-project.org), specifying that a -no-framework version is to be built:
./configure -no-framework --foo --bar
make
sudo make install
After building and installing, qt would be located in(by default)
/usr/local/Trolltech/Qt-4.8.6/lib/pkgconfig/
Thus adding a line to ~/.bashrc
export PKG_CONFIG_PATH="/usr/local/Trolltech/Qt-4.8.6/lib/pkgconfig/:${PKG_CONFIG_PATH}"
would help pkg-config locating the qt in your system.
If you have installed QT by .run file, you might find pkgconfig folder. For me, I have installed QT to "/opt/qt5.15.x/" and I find this path "/opt/qt5.15.x/5.15.2/gcc_64/lib/pkgconfig". Referencing pkg-config-path-environment-variable, I add it to PKG_CONFIG_PATH by
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/qt5.15.x/5.15.2/gcc_64/lib/pkgconfig/
And then, Octave configure find QT. And it's better to check the .pc file in your pkgconfig folder. "prefix" in the .pc files might be wrong.

How to overshadow a package from repository with another version?

I have a glib-2.0 2.36.0 package, installed from ubuntu repo. So now
pkg-config --modversion glib-2.0
Prints 2.36.0 Recently, I downloaded and built a fresh new version 2.40.0. I need it to build a Clutter, also downloaded manually. It requires glib version 2.37.3 at least.
How can I point out a custom pkgconfig directory, that is located in the glib binaries such, that --modversion will return 2.40.0?
The solution is PKG_CONFIG_PATH :
PKG_CONFIG_PATH="$PKG_CONFIG_PATH $HOME/frameworks/glib/lib/pkgconfig/" pkg-config --modversion glib-2.0
Gives the right result.

Finding Libraries using pkg-config in Windows

I am, trying to find the gstreamer lib in windows (msvc) using pkg-config
pkg-config gstreamer-0.10 --cflags --libs
but i am getting any 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 like is created when a library is installed (automatically through the use of an RPM, deb, or other binary packaging system or by compiling from the source).I can't find the .pc file in my gstreamer directory.
Should i just create a .pc file with all the necessary details.
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 there is any other way to do this or Am i missing somthing?
Hope you can help.Thankz for taking the time to read the problem.
Well i am doing this to find solution why i am getting not found message in my waf configure 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 in linux and is supposed to work in windows too.
ADDED LATER
Well making the .pc and setting a path of the .pc dir to the PKG_CONFIG_PATH environment variable does the trick.Its not hard do it
Check out this out. Thankz for readings and helping me..:)
pkg-config is a great tool but unfortunately on Windows (vs. UNIX) there is no standard executable PATH or PKG_CONFIG_PATH.
While you can revert to defining options --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 having a good-looking wscript, especially when using a lot of pkg-config libs.
The typical Win32 user may have issues setting PKG_CONFIG_PATH and PATH directly or stumbling onto a cryptic "not found" error and then checking config.log.
If you do add the windows-specific pkg-config options, it might be interesting for everybody.
You could write a pkgconfig_opts tool and submit it as a waf extra.

Resources