Running a perl module containing use GD, fails with Library not loaded: /usr/local/opt/jpeg/lib/libjpeg.9.dylib
Williams-MBP:~ wmfs$ perl Pulps.pl Can't load '/Library/Perl/5.18/darwin-thread-multi-2level/auto/GD/GD.b +undle' for module GD: dlopen(/Library/Perl/5.18/darwin-thread-multi-2 +level/auto/GD/GD.bundle, 1): Library not loaded: /usr/local/opt/jpeg/ +lib/libjpeg.9.dylib Referenced from: /usr/local/opt/libtiff/lib/libtiff.5.dylib Reason: image not found at /System/Library/Perl/5.18/darwin-thread-m +ulti-2level/DynaLoader.pm line 194. at Pulps.pl line 7. Compilation failed in require at Pulps.pl line 7. BEGIN failed--compilation aborted at Pulps.pl line 7.
Searching the internet indicates this. might be a Homebrew issue; https://looselytyped.com/blog/2017/08/13/dyld-library-not-loaded-error/ gives a method to resolve the issue, which I executed:
Williams-MBP:~ wmfs$ brew info libjpeg jpeg: stable 9d (bottled) Image manipulation library https://www.ijg.org/ /usr/local/Cellar/jpeg/8d (19 files, 708.2KB) * Poured from bottle on 2020-06-19 at 10:50:07 /usr/local/Cellar/jpeg/9d (21 files, 751KB) Poured from bottle on 2020-06-19 at 10:28:04 From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/jp +eg.rb ==> Analytics install: 157,018 (30 days), 537,391 (90 days), 1,811,716 (365 days) install-on-request: 5,369 (30 days), 19,702 (90 days), 72,396 (365 day +s) build-error: 0 (30 days) Williams-MBP:~ wmfs$ brew switch libjpeg 9d Cleaning /usr/local/Cellar/jpeg/9d Cleaning /usr/local/Cellar/jpeg/8d 18 links created for /usr/local/Cellar/jpeg/9d
Running the code again, fails with Library not loaded: /usr/local/opt/jpeg/lib/libjpeg.8.dylib
Williams-MBP:~ wmfs$ perl Pulps.pl Can't load '/Library/Perl/5.18/darwin-thread-multi-2level/auto/GD/GD.b +undle' for module GD: dlopen(/Library/Perl/5.18/darwin-thread-multi-2 +level/auto/GD/GD.bundle, 1): Library not loaded: /usr/local/opt/jpeg/ +lib/libjpeg.8.dylib Referenced from: /Library/Perl/5.18/darwin-thread-multi-2level/auto/ +GD/GD.bundle Reason: image not found at /System/Library/Perl/5.18/darwin-thread-m +ulti-2level/DynaLoader.pm line 194. at Pulps.pl line 7. Compilation failed in require at Pulps.pl line 7. BEGIN failed--compilation aborted at Pulps.pl line 7.
Do anyone have a solution, please?

In reply to Library not loaded - libjpeg by wmfs

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.