How to specify search folder for external library while building ffmpeg

5

4

I want to compile and build ffmpeg in my home folder since I don't have sudo privilege, but how to specify search directories for external libraries while running configure? I try to enable libx264, which is installed in my home folder instead of '/usr/local/', but

./configure --enable-libx264

returns me that libx264 can not be found.

How to tell configure that the libx264 is actually in /home/myusername/local/?

zhanwu

Posted 2011-04-13T19:53:55.607

Reputation: 853

Answers

7

You need to specify extra CFLAGS and LDFLAGS to include the extra library locations:

$ configure --extra-ldflags="-L/path/to/extra/lib" --extra-cflags="-I/path/to/extra/includes"

should do it. You need to specify not the root folder of the libx264, but the folders within that where the compiled library and include files are respectively.

You can specify the -L and -I multiple times inside the quotes to specify multiple extra locations.

Majenko

Posted 2011-04-13T19:53:55.607

Reputation: 29 007

I did want to add --extra-cflags=--static parameter, but in other hand I want to address h264 too. What should I do now?! – Dr.jacky – 2015-12-08T07:28:36.443

Combine the two into one --extra-cflags with quotes as in my example and a space between the different parameters. --extra-cflags="-I/blah/blah/blah -static" – Majenko – 2015-12-08T08:33:07.297

For me it doesn't find a anything and always tries to go by pkgconfig no matter what I try to do – ColdSteel – 2019-10-23T13:31:30.243

yes, it works, but '--extra-cflags="-I/path/to/extra/includes' should be '--extra-cflags="-I/path/to/extra/include'. – zhanwu – 2011-04-13T20:19:57.363