-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Library not loaded: @rpath/libopencv_core.3.4.dylib #1397
Comments
You probably want Remove the |
Thanks @bnoordhuis. I will give it a try. @loader_path I had previously tested, but as you said $ORIGIN could have prevented it from working properly. Will look at it next week when I am back. |
@bnoordhuis, I have tried your suggestion of using This is now the link settings part of my binding.gyp file:
and this is the LC_RPATH part when I run
It seems that it only picks up on the first LC_RPATH. Is there a way to explicitly say that also the others should be considered for @rpath? |
I have now tried to add other absolute paths and that seemed to work just fine. So the problem might be that |
I was a too fast regarding absolute paths working. When I now tried to run the same app file on another machine the original error came up again.
Even though the absolute path was exactly the same on both machines:
|
Here an update to my issue.
However, it still does not work.
Now I just have to get the symlink stuff right :-) |
Finally I made it work.
And in
This keeps everything in a folder. More details about the electron-builder problem can be found here. |
Target: x86_64-apple-darwin17.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Hi,
For my project, which uses the electron-react-boilerplate and electron-builder, I am amongst others including the opencv4nodejs library which also adds a simple script for building opencv. My wish is to create an executable which includes the opencv library.
Building, packaging and running it on the build machine works fine, but as soon as I try the executable on a different machine, I get the following error when executing the app.
dlopen(/Applications/MoviePrint_v004.app/Contents/Resources/app.asar.unpacked/node_modules/opencv4nodejs/build/Release/opencv4nodejs.node, 1): Library not loaded: @rpath/libopencv_core.3.4.dylib Referenced from: /Applications/MoviePrint_v004.app/Contents/Resources/app.asar.unpacked/node_modules/opencv4nodejs/build/Release/opencv4nodejs.node Reason: image not found
Running
otool -l opencv4nodejs.node
shows the following:I am not fully sure how exactly the linking works, but I assumed that rpath does not get resolved properly. Therefore I added multiple rpath options with $ORIGIN and @executable_path to the binding.gyp file for testing. E.g:
This added more LC_RPATH commands/paths to opencv4nodejs.node, but it did not solve my problem. Am I right that the rpath variable in
@rpath/libopencv_core.3.4.dylib
does not get resolved properly? Maybe my tests for referencing are still wrong, but I tried relative paths from the executable as well as from opencv4nodejs.node. Any idea what I am doing wrong, or how I can figure out how rpath gets resolved wrongly?Verbose output (from npm or node-gyp):
The text was updated successfully, but these errors were encountered: