question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Native library not loaded on Linux

See original GitHub issue

Hi I’m having some serious issues with this package. I added the package to my project and copied the native .so file to the root of my ASP.NET Core project. Now when I start the application and try to convert HTML to PDF I get the following error:

(Exception from HRESULT: 0x8007007E)) ---> System.DllNotFoundException: Unable to load DLL 'libwkhtmltox': The specified module could not be found.

I’ve tried setting up LD_LIBRARY_PATH to my app folder. I even copied the .so file to /usr/lib but it doesn’t work at all.

Any ideas what to do here?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:28 (5 by maintainers)

github_iconTop GitHub Comments

16reactions
miguelalvarezicommented, May 15, 2018

@fernandovictorTI, I believe the problem is that the second stage of your build (runtime) is not running the below command again, so libwkhtmltox and it’s dependencies are left in the first stage (build).

RUN apt-get update \
    && apt-get install -y --no-install-recommends \
        zlib1g \
        fontconfig \
        libfreetype6 \
        libx11-6 \
        libxext6 \
        libxrender1 \
    && curl -o /usr/lib/libwkhtmltox.so \
        --location \
        https://github.com/rdvojmoc/DinkToPdf/raw/v1.0.8/v0.12.4/64%20bit/libwkhtmltox.so
8reactions
rdvojmoccommented, Jul 31, 2017

After install of libgdiplus in microsoft/dotnet:1.1.2-runtime image libwkhtmltox library is found.

image

Dockerfile:

FROM microsoft/dotnet:1.1.2-runtime

RUN ["apt-get", "update"]
RUN ["apt-get", "-y", "install", "libgdiplus"]

WORKDIR /app

COPY / .

ENTRYPOINT ["dotnet", "DinkToPfd.TestConsoleApp.dll"]

Result: 636370886662487690.pdf

Thanks @Ahmed-Raouf for pointing this out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

J2V8 native library not loaded · Issue #260
It seems that j2v8 can only run one application in one computer(both in windows and linux). Any fix? I think the file ~/libj2v8_win32_x86_64.dll...
Read more >
Failed to load native library 'libnative-platform.so' for Linux ...
FAILURE: Build failed with an exception. * What went wrong: Failed to load native library 'libnative-platform.so' for Linux amd64.
Read more >
Cannot load native library for Linux/amd64
couchbase lite is giving intermittent error for loading native library in PCF while it runs fine in local windows 10 machine.
Read more >
java.lang.UnsatisfiedLinkError: Library not found tibrvnative ...
8 Steps to Solve "Library not found tibrvnative or android" Error in Java · 1. Check library availability · 2. Verify library compatibility...
Read more >
Library not loaded (OS X)
In short, library is not loaded when from outside its native directory. The sequence of commands triggering the problem is the following ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found