Hi all,
I’m maintaining a C++/Qt application that uses GraphViz to render diagrams using the “neato” plugin. Overall it’s working fine.
One issue is that GraphViz needs to find the file libgvplugin_neato_layout.6.dylib
at runtime in order to work. When the application is built using our Jenkins build server, that’s no problem; the build-script is set up to copy that file (along with all of the other necessary files) into MyApp.app/Contents/Frameworks
, so everything “just works” when the user installs the app.
My question is about developer builds, though – when building the app locally on my machine using qmake
, qmake doesn’t know that the plugin files need to be copied in to the Frameworks folder, so after I manually build the program (using qmake ; make
) and try to run it, I get a crash-on-startup (as shown below). Then I have to run a separate shell script to copy the files over, and after that the app runs okay.
My question is, is there any way that I could avoid having to copy the files over in this situation, e.g. by programmatically specifying a directory-path where graphviz should look to find its plugins? That would be a bit more elegant than having to make a copy of the plugins every time I do a clean build.
FWIW I tried adding the path to the plugins to my LD_LIBRARY_PATH
environment variable, but that did not seem to make any difference.
Thanks,
Jeremy
Termination Reason: Namespace DYLD, Code 1 Library missing
Library not loaded: @rpath/libgvplugin_neato_layout.6.dylib
Referenced from: /Users/USER/*/MyApp.app/Contents/MacOS/MyApp
Reason: tried: ‘/Users/jaf/sandbox/apps/MyApp/build/release/MyApp.app/Contents/Frameworks/libgvplugin_neato_layout.6.dylib’ (no such file),
‘/Users/jaf/qt-everywhere-src-5.15.14/qtbase/lib/libgvplugin_neato_layout.6.dylib’ (no such file),
‘/System/Volumes/Preboot/Cryptexes/OS/Users/jaf/qt-everywhere-src-5.15.14/qtbase/lib/libgvplugin_neato_layout.6.dylib’ (no such file),
‘/Users/jaf/sandbox/apps/MyApp/build/release/MyApp.app/Contents/Frameworks/libgvplugin_neato_layout.6.dylib’ (no such file),
‘/Users/jaf/qt-everywhere-src-5.15.14/qtbase/lib/libgvplugin_neato_layout.6.dylib’ (no such file),
‘/System/Volumes/Preboot/Cryptexes/OS/Users/jaf/qt-everywhere-src-5.15.14/qtbase/lib/libgvplugin_neato_layout.6.dylib’ (no such file),
‘/usr/local/lib/libgvplugin_neato_layout.6.dylib’ (no
(terminated at launch; ignore backtrace)
Thread 0 Crashed:
0 dyld 0x7ff81c258c42 __abort_with_payload + 10
1 dyld 0x7ff81c272fd7 abort_with_payload_wrapper_internal + 82
2 dyld 0x7ff81c273009 abort_with_payload + 9
3 dyld 0x7ff81c1f78f0 dyld4::halt(char const*) + 375
4 dyld 0x7ff81c1f4b71 dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 4526
5 dyld 0x7ff81c1f33bd start + 1805