:: Re: [Frei0r] frei0r-plugins depende…
Página Principal
Delete this message
Reply to this message
Autor: Cristian Morales Vega
Data:  
Para: Minimalistic plugin API for video effects
Assunto: Re: [Frei0r] frei0r-plugins dependencies?
On 4 Apr 2016 6:23 p.m., "Jean-Baptiste Mardelle" <jb@???> wrote:
>
> On Monday, April 4, 2016 11:25:08 AM CEST, Izak van Langevelde wrote:
>
>
>> I got an update today, with fresh bugs:
>>
>> /usr/bin/melt: symbol lookup error: /usr/lib/frei0r-1/levels.so:

undefined symbol: floor
>> I believe this needs a little more attention.
>
>
> Hi,
>
> yes, looks like I was a bit too fast on this one. I had a closer look,

and 90% of frei0r plugins seem to use libmath. We have 2 options here:
>
> 1) easy solution: add libmath linking to the top CmakeLists.txt with this

patch. Should solve the crashes, but causes some unwanted linking.
>
> index bb143d6..dc8d3d9 100644
> --- a/src/CMakeLists.txt
> +++ b/src/CMakeLists.txt
> @@ -1,3 +1,4 @@
> +link_libraries(m)
> add_subdirectory (filter)
> add_subdirectory (generator)
> add_subdirectory (mixer2)
>
>
> 2) Parse each subdirectory to edit CMakeLists.txt and add the line
>
> link_libraries(m)
>
> where needed. At first it seems easy, but in fact not so much if we want

to do it properly. Some plugins have the "math.h" include but don't use it,
so the proper fix would be to remove the include (for example
cairogradient). And to make things more complicated, some math functions
work without additionnal linking - seems to be compiler dependant from what
I read, for example cluster.c uses "sqrtf" but works without libmath
linking, while levels.c crashes on "floor" if linking is missing.

With GNU ld you have --as-needed. You can link everything with -lm, but it
will only be used (a DT_NEEDED every will be created in the ELF) if it's
actually required.