mozilla / mozjpeg

Improved JPEG encoder.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

relocation error: /opt/mozjpeg/jpegtran: symbol jpeg_c_int_param_supported, version LIBJPEG_6.2 not defined in file libjpeg.so.62

ghnp5 opened this issue · comments

commented

Hello,

This is how I built 4.0.2:

$ cd /usr/local/src
$ wget https://github.com/mozilla/mozjpeg/archive/v4.0.2.tar.gz
$ tar -xvzf v4.0.2.tar.gz
$ cd mozjpeg-4.0.2
$ mkdir build
$ cd build
$ cmake .. -DPNG_SUPPORTED=NO
$ make -j8
$ mv /usr/local/src/mozjpeg-4.0.2/build /opt/mozjpeg

Then I run "jpegtran",

$ /opt/mozjpeg/jpegtran -copy none -optimize -outfile out.jpg in.jpg

I get this:

/opt/mozjpeg/jpegtran: relocation error: /opt/mozjpeg/jpegtran: symbol jpeg_c_int_param_supported, version LIBJPEG_6.2 not defined in file libjpeg.so.62 with link time reference

The symlinks seem to be ok...

lrwxrwxrwx 1 root root 13 2021-02-12 01:07 libjpeg.so -> libjpeg.so.62
lrwxrwxrwx 1 root root 17 2021-02-12 01:07 libjpeg.so.62 -> libjpeg.so.62.3.0
-rwxr-xr-x 1 root root 757400 2021-02-12 01:07 libjpeg.so.62.3.0
-rw-r--r-- 1 root root 1075160 2021-02-12 01:07 libturbojpeg.a
lrwxrwxrwx 1 root root 17 2021-02-12 01:07 libturbojpeg.so -> libturbojpeg.so.0
lrwxrwxrwx 1 root root 21 2021-02-12 01:07 libturbojpeg.so.0 -> libturbojpeg.so.0.2.0
-rwxr-xr-x 1 root root 849600 2021-02-12 01:07 libturbojpeg.so.0.2.0

Any ideas what that error above is about?
Thank you.

@ghnp5 say:

Any ideas what that error above is about?

🔨 You are not the jpegtran you are trying to use. You should use the one that compiles with libjpeg (included in mozjpeg).

commented

@zvezdochiot Apologies, but what do you mean with:

You are not the jpegtran you are trying to use.

And what is "the one" that compiles with libjpeg, then?

I'm very confused here.
Thank you.

It looks like you've build jpegtran to use libjpeg as a shared library, but installed only jpegtran, but not the shared library that it needs.

Use either jpegtran-static, or install all of MozJPEG's libjpeg system-wide.

commented

Use either jpegtran-static

Thank you @kornelski -- seems that "jpegtran-static" works! Doesn't trigger the error.