[FFmpeg-devel] [PATCH] configure: add libm ldflags globally

Jan Ekstrom jeebjp at gmail.com
Tue Oct 17 01:13:03 EEST 2017


On Tue, Oct 17, 2017 at 12:38 AM, Hendrik Leppkes <h.leppkes at gmail.com> wrote:
> Perhaps such libraries shouldn't hardcode -lstdc++ in there, but
> dynamically put whichever C++ library they built against in there
> instead?
> Its not like you can actually use a static library build with another
> C++ library, that *may* randomly work, but its not something anyone
> should be doing.
>
> - Hendrik

Yup,

The project should know which C++ runtime it is built against and put
that into the .pc file's Libs.private. If the project doesn't have an
idea on how to automate this, a solution like the one utilized by zimg
is valid as well:

* Check for an environment variable during configuration and set the
default to `-lstdc++`
(https://github.com/sekrit-twc/zimg/blob/ae673e02c8e934915e05daeb120c7cb1b500a0a4/configure.ac#L55..L56)
* Set that value in your pkg-config template
(https://github.com/sekrit-twc/zimg/blob/ae673e02c8e934915e05daeb120c7cb1b500a0a4/zimg.pc.in#L13)

This way in case the value is incorrect the user can set the
environment variable, and then get what is needed.


Jan


More information about the ffmpeg-devel mailing list