soimy/msdf-bmfont-xml

libpng12.so.0: cannot open shared object file: No such file or directory

smaznet opened this issue ยท 13 comments

libpng12.so.0: cannot open shared object file: No such file or directory

i got this error on centos 7

how i can fix it?

soimy commented

@smaznet Have you tried installing libpng-dev package?

Also to mention: msdfgen binary for linux in this repo is old and not updated yet. I've tried newest prebuilt binary but too many dependency make it impossible fit for all linux distro. Consider build it yourself from https://github.com/ckohnert/msdfgen

soimy commented

@smaznet did your problem solved? Hope to get your feedback and I'll let this issue open as an Q&A

@soimy I think I'm having the same issue. With libpng-dev installed to 1.6.28-1, I still get this error:

module.js:672
  return process.dlopen(module, path._makeLong(filename));
                 ^

Error: libpng12.so.0: cannot open shared object file: No such file or directory
    at Object.Module._extensions..node (module.js:672:18)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/donmccurdy/.nvm/versions/node/v8.9.4/lib/node_modules/msdf-bmfont-xml/node_modules/canvas-prebuilt/canvas/lib/bindings.js:3:18)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
$ uname -a
Linux dm-msdf-test 4.9.0-5-amd64 #1 SMP Debian 4.9.65-3+deb9u2 (2018-01-04) x86_64 GNU/Linux

Do you have instructions for building it, and was there a particular reason you linked to a fork of msdfgen instead of the original?

soimy commented

Take a look at Chlumsky/msdfgen#57 , Compiling on linux is just the same.
To be more specific:

git clone https://github.com/ckohnert/msdfgen.git
mkdir ./msdfgen/out && cd ./msdfgen/out && cmake .. && make

Note: Make sure to install cmake and build-essential first.
After a successful compile, copy the generated msdfgen to msdf-bmfont-xml module's bin folder and rename it: msdfgen.linux

About your second question:

ckohnert's fork of msdfgen adds more tolerance fixes on font shape than the original repo. There are plenty of font with minor error which is not noticeable in normal rendering but will damage generated signed-distance field maps.

In spite of having libpng16 already installed, the same error was thrown when using this package on debian 9.
The issue was solved by specifically installing libpng12 (thanks @f2dmarques).
Building msdfgen didn't do it though.

The dependency of libpng is from this package, right? Isn't there a way to use the latest version instead?

Thanks!

Thanks! Things are working now, although installing libpng12 on Google Compute Engine required adding a repository.

Here are the steps I needed in the end: https://gist.github.com/donmccurdy/03b9e072d11c4c393415062bf3d50670

soimy commented

Good to hear that! and sorry for the inconvenience.
Just spent some time looking at the old msdfgen.linux binary and found that localized libpng12.so.0 is not included. The current mac/win binary of msdfgen dependencies(.dll and .dylib) are all localized.
I'll fix that.

soimy commented

Test needed 79cc79f

Thanks, it's working great! Setup on GCE (Ubuntu 16.04 LTS image) is much simpler now.

That's awesome! I'll also give it a try tomorrow in Debian 9.

soimy commented

npm repo version bump via c7e2e3f

Just tested in Debian 9, but it keeps raising the error: libpng12.so.0: cannot open shared object file: No such file or directory (...).

Installing libpng12 solves the issue though.

soimy commented

Fixed via bca20ca