Menu

Ghost4j Mac Unable to load library

Help
2011-12-05
2013-04-29
  • Martin Hollerweger

    I am trying to get Ghost4j working on my Mac with OS X Lion.
    My project works on Windows but on OS X i get following error: Unable to load library 'gs': dlopen(libgs.dylib, 1):
    - I installed Ghostscript with Macports:  sudo install port Ghostscript
    - Added /opt/local/lib to the Path where libgs.dylib is located
    - Didn't work so i added a Symbolic link at the project root
    - Next I tried to add the Native library to the jar at the Eclipse build path

    … unfortunately nothing worked

    Ghost4j: ghost4j-0.4.4.jar
    Ghostscript: 9.02
    Eclipse: Indigo
    OSX: Lion

    Stacktrace:
    Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'gs': dlopen(libgs.dylib, 1): image not found
    at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:145)
    at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:188)
    at com.sun.jna.Library$Handler.<init>(Library.java:123)
    at com.sun.jna.Native.loadLibrary(Native.java:255)
    at com.sun.jna.Native.loadLibrary(Native.java:241)
    at net.sf.ghost4j.GhostscriptLibraryLoader.loadLibrary(GhostscriptLibraryLoader.java:36)
    at net.sf.ghost4j.GhostscriptLibrary.<clinit>(GhostscriptLibrary.java:32)
    at net.sf.ghost4j.Ghostscript.initialize(Ghostscript.java:292)
    at net.sf.ghost4j.renderer.SimpleRenderer.run(SimpleRenderer.java:83)
    at net.sf.ghost4j.renderer.AbstractRemoteRenderer.render(AbstractRemoteRenderer.java:79)
    at mhollerw.pdftoimage.ConverterThread.convert(ConverterThread.java:53)

     
  • zippy1978

    zippy1978 - 2011-12-05

    Hi,
    Did you try to put all GS .dylib in your project root instead of symlinks ?

     
  • Martin Hollerweger

    Thank you for your quick answer. I tried it now but it didn't work too.

     
  • zippy1978

    zippy1978 - 2011-12-05

    Actually I never tried with Lion. But I remember it worked on Snow Leopard… I will have a closer look at it…

     
  • Martin Hollerweger

    Probably there are problems with 64 bit. (I had problems on windows too with the old Ghost4j version. I solved it by running all in 32Bit. I saw that the new version also works for 64 bit)
    Unfortunately i haven't found out the Ghostscript library mode because i can't run it.
    I tried to use the vm argument -d32 to run the java vm in 32 Bit mode but this didn't resolve the problem.

     
  • paolofuse

    paolofuse - 2012-01-19

    Hi,
    same issue for me. I'm using Mac OSX Lion 64 bit and I get same error:

    Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'gs': dlopen(libgs.dylib, 1): image not found

    Any suggestions?

    Thanks.
    paolofuse

     

Log in to post a comment.