sekrit-twc / zimg

Scaling, colorspace conversion, and dithering library
Do What The F*ck You Want To Public License
405 stars 77 forks source link

Can I build ffmpeg dynamic library with zimg? #197

Closed chencuber closed 1 year ago

chencuber commented 1 year ago

I want to build ffmpeg dynamic library with zimg, however there is an error saying "/usr/bin/ld: /home/build/lib//libzimg.a(libzimg_internal_la-zimg.o): relocation R_X86_64_TPOFF32 against `__tls_guard' can not be used when making a shared object; recompile with -fPIC".

The configuration of building zimg is as follows: ./configure --prefix={$prefix_dir} --enable-shared --with-pic

Any errors with the above configuration? Can I build ffmpeg dynamic library with zimg or I only can build static ffmpeg library with zimg?

sekrit-twc commented 1 year ago

This error indicates that you are trying to link a static library into a shared library, which requires -Wl,-Bdynamic. To build z.lib as a shared library, use --enable-shared --disable-static, and also delete any already compiled binaries.

chencuber commented 1 year ago

This error indicates that you are trying to link a static library into a shared library, which requires -Wl,-Bdynamic. To build z.lib as a shared library, use --enable-shared --disable-static, and also delete any already compiled binaries.

Thanks, It works!