0

I compiled some source code to build and app, everything compiles fine but now I am getting linking/ dependency errors so the app crashes on load.

Here is an the error

Dyld Error Message:
  Library not loaded: libstreamanalyzer.0.dylib
  Referenced from: /usr/local/lib/libkio.5.dylib
  Reason: image not found

using otool -L on this file in question i get

/opt/krita/lib/libkio.5.dylib (compatibility version 5.0.0, current version 5.14.3)
/opt/krita/lib/libkdeui.5.dylib (compatibility version 5.0.0, current version 5.14.3)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
/usr/local/Trolltech/Qt-4.8.6/lib/QtNetwork.framework/Versions/4/QtNetwork (compatibility version 4.8.0, current version 4.8.6)
/usr/local/Trolltech/Qt-4.8.6/lib/QtXml.framework/Versions/4/QtXml (compatibility version 4.8.0, current version 4.8.6)
/usr/local/Trolltech/Qt-4.8.6/lib/QtSvg.framework/Versions/4/QtSvg (compatibility version 4.8.0, current version 4.8.6)
libstreamanalyzer.0.dylib (compatibility version 0.0.0, current version 0.7.8)
libstreams.0.dylib (compatibility version 0.0.0, current version 0.7.8)
/opt/krita/lib/libsolid.4.dylib (compatibility version 4.0.0, current version 4.14.3)
/opt/krita/lib/libkdecore.5.dylib (compatibility version 5.0.0, current version 5.14.3)
/usr/local/Trolltech/Qt-4.8.6/lib/QtDBus.framework/Versions/4/QtDBus (compatibility version 4.8.0, current version 4.8.6)
/usr/local/Trolltech/Qt-4.8.6/lib/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.6)
/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 157.0.0)
/usr/local/Trolltech/Qt-4.8.6/lib/QtGui.framework/Versions/4/QtGui (compatibility version 4.8.0, current version 4.8.6)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)

anyone have any tips on solving this issue?

[EDIT] using find on my system it shows

/opt/krita/lib/cmake/LibStreamAnalyzer/LibStreamAnalyzerConfig.cmake
/opt/krita/lib/pkgconfig/libstreamanalyzer.pc
/opt/krita/lib/libstreamanalyzer.0.7.8.dylib
/opt/krita/lib/libstreamanalyzer.0.dylib
/opt/krita/lib/libstreamanalyzer.dylib

doing export DYLD_LIBRARY_PATH=/opt/krita/lib:$DYLD_LIBRARY_PATH like vsoftco suggested and the app still crashes with the exact same error.

steffan
  • 169
  • 3
  • 18

1 Answers1

1

The OS cannot find the dynamic library. Apple's OS X is a bit different from linux, and even if you link the library successfully, you may still get in trouble when running the program.

The solution is to set the environment variable

DYLD_LIBRARY_PATH

to the path where your library libstreamanalyzer is located. From the OS X console, type

export DYLD_LIBRARY_PATH=/path/to/library:$DYLD_LIBRARY_PATH

then try running the program.

If you run the program from an IDE like XCode or Eclipse, there is an option of specifying environment variables.

vsoftco
  • 55,410
  • 12
  • 139
  • 252
  • I tried that but it still crashes, see my latest edit. – steffan Feb 09 '15 at 06:30
  • are you running the program from the terminal line? if yes, make sure you run the program from the same terminal session (i.e., don't close the terminal or open a new tab, as the export statement is not persistent, unless you put it in your .profile) – vsoftco Feb 09 '15 at 06:35
  • Yes I am trying it directly in the same terminal after exporting the path. – steffan Feb 09 '15 at 06:39
  • @steffan not sure then what is going on, usually this should have done it. I assume you use bash. Is the path set when you type `echo $DYLD_LIBRARY_PATH`? Also, try putting the path inside double quotes like `"path/to/lib"` and just use `export DYLD_LIBRARY_PATH="/opt/krita/lib"` Hope it works. – vsoftco Feb 09 '15 at 06:45