miyako / console-rsvg-convert

rsvg-convert clone
52 stars 8 forks source link

Build on macOS, won't run, dylib error #2

Closed emendelson closed 3 years ago

emendelson commented 5 years ago

Hello,

This is a wonderful project. Thank you. Unfortunately, if I try to build in Xcode 9, the resulting build produces this error:

dyld: Library not loaded: @loader_path/libiconv.2.dylib Referenced from: /Users/edward/Development/console-rsvg-convert-master/dylib/libxml2.2.dylib Reason: Incompatible library version: libxml2.2.dylib requires version 8.0.0 or later, but libiconv.2.dylib provides version 7.0.0

Perhaps the dylib is your own Library folder, so the build succeeds on your system, but not on another system?

Thank you for any help with this.

miyako commented 5 years ago

I've added iconv in the project's lib folder. does that make a difference?

emendelson commented 5 years ago

Thank you for looking at this. The new code builds, but produces this error when run:

dyld: Symbol not found: _inflateValidate Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib Expected in: /Users/edward/Desktop/console-rsvg-convert-master/dylib/libz.1.dylib in /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib (lldb)

miyako commented 5 years ago

may I ask why you are interested in this project? if you just want rsvg-convert you could just use homebrew.

emendelson commented 5 years ago

Hello,

I use your command-line rsvg-convert in an AppleScript-based conversion program that converts WordPerfect files to DOCX using Pandoc and WordPerfect graphics to SVG, using an open-source tool, and then to PNG using your software. The program is here:

http://www.columbia.edu/~em36/wpdos/wpfilesinosx.html#wpexport

I can only use executables that don't require Brew, etc., for programs that I distribute. Your older version of rsvp-convert works perfectly well, but won't run under Catalina because parts of it are 32-bit. So I was hoping to build a new version.

Thank you!

miyako commented 5 years ago

interesting.

you can always remove 32-bit code by running something like

lipo -remove i386 ...

but I will put building 64-bit version on my TODO list

emendelson commented 5 years ago

Wait - apologies - I was wrong!! The problem is not about 32-bit code - I shouldn't have said anything about that! When I wrote my comment, I had forgotten what the problem is, and now I remember it:

I want to notarize my converter application, but Apple will not notarize binaries built with an SDK older than the 10.9 SDK. Two libraries in the version of your clone that I built a year or two ago use an older SDK:

libxml2.2.dylib libiconv.2.dylib

I was hoping to build one with newer dylibs. I tried replacing the old libraries with new ones that I found elsewhere, but I got various error messages. And anyway, now I see that your code still contains the old libraries, so there is no reason for me to build a new version!

Don't bother about this - I don't need to notarize my app, though I would be nice to be able to do so.

miyako commented 5 years ago

That makes total sense.

I used to select older SDKs to support that widest range of platforms, but that was before the notarization arrangement.

I would love to build rsvg-convert with static libraries, but have never succeeded, maybe because GLIB is shared between several libraries and not ready for such usage at least without some tweaking.

emendelson commented 5 years ago

More progress. I replaced the older dylibs in your release package with libxml2.2.dylib from /lib and I built libiconv, and found libiconv.2.dylib in a hidden .libs folder. With these two files replacing the ones in your download, I was able to notarize my application.

I still can't build your current code, even with those updated dylibs, but this makes it possible to make a notarized app. Thank you again for this superb project.

miyako commented 3 years ago

should be OK on Catalina

https://github.com/miyako/console-rsvg-convert/releases/tag/2.1.1

emendelson commented 3 years ago

Thank you!