Fix detection of static x265 lib via pkg-config

Issue #136 resolved
djcj created an issue

When I try to build ffmpeg with embedded libx265 on Linux, configure fails detecting the static library. But I was able to fix this by adding the "private libraries" listed in x265.pc to the output of "pkg-config --libs x265".

Or to be more precise, change these lines in source/x265.pc.in

Libs: -L${libdir} -lx265
Libs.private: @PRIVATE_LIBS@

to this:

Libs: -L${libdir} -lx265 @PRIVATE_LIBS@
Libs.private:

Comments (4)

  1. Brad Smith

    The proposed change is wrong. You're using pkg-config incorrectly. If you're trying to statically link FFmpeg to a static archive version of x265 then you need to use the --static flag for pkg-config. FFmpeg's configure script has an option to pass that along... --pkg-config-flags="--static".

  2. djcj reporter

    No, I don't want a static ffmpeg binary, I only want to link it against the static x265 library (mostly because of the many API changes), the other stuff should be linked dynamically as usual.

  3. Ricardo Constantino

    If you want to link to x265 statically you still add "--static" to pkg-config options. That's the proper way of getting the private libs.

  4. djcj reporter

    I'll mark this issue as resolved as it doesn't seem to be an issue with the provided pkg-config file itself.

  5. Log in to comment