./configure include directories

Dec 24, 2017 at 4:12am
I'm wondering if anyone has an idea how to let ./configure be able to find the headers of another library that I installed.

In msys2 (so it is Windows, but this should be fully compatible with the Linux solution), I built LAME 3.100
https://sourceforge.net/projects/lame/?source=typ_redirect
through
1
2
3
./configure
make
make install


Had to deal with the this bug ( https://sourceforge.net/p/lame/bugs/487/ ) but the installation went smoothly otherwise.

Then I try to install libav 12.2 by typing
./configure --enable-libmp3lame --enable-libvpx

This eventually leads to the error,
1
2
3
4
5
gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1 -D__printf__=__gnu_printf__ -DPIC -std=c99 -fomit-frame-pointer -E -o /tmp/ffconf.DPVNZ61z.o /tmp/ffconf.8S39YF2b.c
C:/msys64/tmp/ffconf.8S39YF2b.c:1:10: fatal error: lame/lame.h: No such file or directory
 #include <lame/lame.h>
          ^~~~~~~~~~~~~
compilation terminated.


If this were just me compiling a project, I could pretty easily add the appropriate include dir to the compiler (gcc/g++) command line with -I<blah>.

But how do I get tell ./configure to know where to find lame/lame.h?
Or any particular include (or library) for the next time this happens?

I am trying to google the answer, but it's hard because the word "configure" gets overshadowed by so many other, unrelated search results.

Thank you for reading!
Last edited on Jan 22, 2018 at 11:23pm
Dec 24, 2017 at 10:58am
I think that the configure script should be able to show what options it does accept:
./configure --help
Dec 24, 2017 at 8:44pm
Thank you. I ended up having to go inside the lame-3.100/include directory, add another folder called "lame", and then copy lame.h into that one, get the #include <lame/lame.h> to work properly.

Unlike, for example, fftw3, it seems that LAME didn't actually install any of the files into /usr/include or /usr/lib.

Adding --extra-ldflags="-L/c/dev/libs/lame-3.100/libmp3lame/.libs" --extra-cflags="-I/c/dev/libs/lame-3.100/include" seems to have made the LAME-related errors go away.

So that solves my initial OP question. Now the problem is libvpx, haha...

./configure --enable-libmp3lame --enable-libvpx --extra-ldflags="-L/c/dev/libs/lame-3.100/libmp3lame/.libs" --extra-cflags="-I/c/dev/libs/lame-3.100/include" --extra-ldflags="-L/c/dev/libs/libvpx-master" --extra-cflags="-I/c/dev/libs/libvpx-master"
produces the following error in config.log
1
2
3
4
5
gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1 -D__printf__=__gnu_printf__ -DPIC -I/c/dev/libs/lame-3.100/include -I/c/dev/libs/libvpx-master -std=c99 -fomit-frame-pointer -c -o /tmp/ffconf.cEigZyZ7.o /tmp/ffconf.wlP2ch1x.c
gcc -L/c/dev/libs/lame-3.100/libmp3lame/.libs -L/c/dev/libs/libvpx-master -Wl,--nxcompat -Wl,--dynamicbase -Wl,--as-needed -o /tmp/ffconf.y15eYjHC.exe /tmp/ffconf.cEigZyZ7.o -lmp3lame -lm -lpsapi -ladvapi32 -lshell32
check_pkg_config vpx >= 1.3.0 vpx/vpx_codec.h vpx_codec_version
false --exists --print-errors vpx >= 1.3.0
ERROR: vpx >= 1.3.0 not found


I know that my vpx version is above 1.3.0. So this is frustrating.

What a mess, lol. Going to keep searching google...
Last edited on Dec 24, 2017 at 8:46pm
Jan 19, 2018 at 3:46am
Okay, so, just to update to bring this to some close.

To solve this error of it not finding vpx >= 1.3.0, despite my version of vpx being 1.6.1, I first made sure that pkg-config was working correctly. This required downloading and copying the correct DLLs on the Windows side, which can be gotten, for example, from
http://www.codeblocks.org/downloads/26 codeblocks-17.12mingw-nosetup.zip in mingw/bin

Once pkg-config can be run without complaining about needing a DLL to run, I ran
pkg-config --exists --print-errors vpx >= 1.3.0
This gives a hint,
1
2
3
Package vpx was not found in the pkg-config search path.
Perhaps you should add the directory containing `vpx.pc'
to the PKG_CONFIG_PATH environment variable 


vpx.pc is in my libvpx-master directory, so I added that path to PKG_CONFIG_PATH.

I ran the following commands:
1
2
3
4
PATH=$PATH:/c/mingw/bin
cd /c/dev/libs/libav-12.2
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/c/dev/libs/libvpx-master
./configure --enable-libmp3lame --enable-libvpx --extra-ldflags="-L/c/dev/libs/lame-3.100/libmp3lame/.libs" --extra-cflags="-I/c/dev/libs/lame-3.100/include" --extra-ldflags="-L/c/dev/libs/libvpx-master" --extra-cflags="-I/c/dev/libs/libvpx-master"


And configuration seems to have completed successfully! Hopefully the rest of the installation will work as well.
Maybe this will help someone that might google this in the future, haha.

_______________________________________
_______________________________________

Update:
make and make install worked as well.

I was able to compile the sample project located at https://libav.org/documentation/doxygen/master/encode__video_8c_source.html with the following command line.

g++.exe -LC:\dev\libs\libav-12.2\libavcodec -LC:\dev\libs\libav-12.2\libavformat -LC:\dev\libs\libav-12.2\libavutil -LC:\dev\libs\lame-3.100\libmp3lame\.libs -LC:\dev\libs\libvpx-master -LC:\dev\libs\libav-12.2\libavresample -o bin\Debug\libav_test.exe obj\Debug\main.o -lavcodec -lavformat -lavutil -lmp3lame -lvpx -lavresample

The file it makes is 50 MB, although this is also without optimizations... I guess that's what static linking a bunch of things inevitably does.
Last edited on Jan 21, 2018 at 2:36am
Topic archived. No new replies allowed.