Im creating a project in Xcode using OpenCV as a framework. It works great with the Build&Run option from Xcode, but now I need to run it in the Terminal and it gives me this error:
dyld: Library not loaded: #executable_path/../Frameworks/OpenCV.framework/Versions/A/OpenCV
Referenced from: /Users/Victor/Documents/PFC/src/opencv/blob/build/Release/./test3
Reason: image not found
Trace/BPT trap
I look for the build and just execute it with ./
So, any clue?
You need to run it from the build directory rather than the Release directory (assuming Frameworks is a directory in blob)
Related
I have a console application project which uses my own framework. When I build and run the application from Xcode it's executed successfully. However when I try to open the executable from terminal outside of Xcode I get the following error:
dyld: Library not loaded: #rpath/Logic.framework/Versions/A/Logic
Referenced from: /Users/semyon/Library/Developer/Xcode/DerivedData/VocalTrainer-fyzwymbxfxusrqejhssrjfeovnqg/Build/Products/Debug/./MvxGenerator
Reason: image not found
zsh: abort ./MvxGenerator
The question is: How to deliver the release build of my command line application which uses a framework?
You need to install the framework/ dynamic library at #executable_path/../Resources/lib folder. If you share a .app bundle, just copy it in Contents/MacOS/Resources/lib folder. If a binary, make sure your installer keeps the framework at the right place.
You may want to inspect other open source app bundles which do this:
Cmake
Visual Studio Code
etc
CMake relative newbie.
I currently have a Cross-compiling (Windows 10/CentOS) project where I have added a post-build hook to automatically run Google Test, using this method.
Everything works great in Windows and Linux, it correctly builds then executes the Google Test Executable. However, on our Window's server Jenkin's build system, I keep getting the following:
CMake Error at <path to cmake>/cmake-3.17/Modules/GoogleTestAddTests.cmake:40 (message):
Error running test executable.
Path: '<path to project root>/build/extern/<submodule>/tests/Debug/<project>.test.exe'
Result: Exit code 0xc0000135
Doing research, the error code seems to be related to the exe missing a dynamically linked library. However, I can't figure out if it is the main project library (call it project.lib) is missing, or something else. Any help/experience on debugging this would be appreciated.
Just to give an answer:
It turned out the dll libraries for Windows .Net was not installed. After installing them/making sure they were on the path, the problem resolved itself.
I had the same problem with Catch2 on an integration machine using Azure DevOps.
The integration report displays:
CMake Error at C:/Projets/<PROJECT>/application/testing/Catch2/extras/CatchAddTests.cmake:45 (message):
Error running test executable
'C:/Projets/<PROJECT>/application/build/testing/Process/Debug/testing_Process.exe':
Result: Exit code 0xc0000135
Output:
The root cause: the testing_Process.exe binary is missing a required .dll library of external SDK.
The solution: Add the .dll required to the system path of the integration machine.
I am new to flutter. I have created small flutter app and i wanna test it on my real devices but i am unable to generate ios ipa file for testing. Please if anyone could help me with this issues then it would be good for me.thanks in advance!!
I getting this error . :
*iMac:test_app snehal$ flutter build ios
Building com.org.testApp for device (ios-release)...
Automatically signing iOS for device deployment using specified development team in Xcode project: 5GC7G69Y22
Starting Xcode build...
Xcode build done. 5.1s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Release ===
ld: library not found for -lPods-Runner
clang: error: linker command failed with exit code 1 (use -v to see invocation) Encountered error while building for device.*
In new projects, in the iOS part is necessary to adjust a few parameters, such as signing, and that you can only do in Xcode.
So, try to open the iOS project with Xcode and try to build it from there. You'll see better warning and error messages there, specially regarding signing.
You can open Xcode and locate your project ios folder, or:
cd yourproject/ios
open -a Xcode .
Then select Product > Run in the menu.
I'm trying to run the following example found at http://www.box.net/shared/xmazi14uv2.
But when I make and try to run the executable, I encounter the following error:
./demo
dyld: Library not loaded: #rpath/libeng.dylib
I've had no success searching the web. I'm running MATLAB_R2014b on a MacBook Pro Air.
I don't use or even have access to a Mac, but I think you need to setup some environment variables when you run applications using the MATLAB Engine:
export PATH='/path/to/MATLAB_R2014b.app/bin':$PATH
export DYLD_LIBRARY_PATH='/path/to/MATLAB_R2014b.app/bin/maci64:/path/to/MATLAB_R2014b.app/sys/os/maci64':$DYLD_LIBRARY_PATH
I am trying to deploy a Qt program on Mac according to this link. After going through with otool -L on my executable and all of the libraries that it depends on, which I copied into the application bundle, I get this error in QtCreator's application output when I try to run it.
This application failed to start because it could not find or load the Qt platform plugin "cocoa".
Reinstalling the application may fix this problem.
The program has unexpectedly finished.
I've tried copying the qt platform plugins libqcocoa.dylib and changing the plugins directory in qt.conf, according to this, but it still fails.
Also worth pointing out, I first tried to use qt's macdeployqt tool, but it fails with this message, despite being the first time I run it on the executable:
ERROR: Could not find bundle binary for "MyProgram.app/Contents/MacOS/MyProgram"
ERROR: "otool: can't open file: (No such file or directory)"
WARNING:
WARNING: Could not find any external Qt frameworks to deploy in "MyProgram.app/Contents/MacOS/MyProgram"
WARNING: Perhaps macdeployqt was already used on "MyProgram.app/Contents/MacOS/MyProgram" ?
WARNING: If so, you will need to rebuild "MyProgram.app/Contents/MacOS/MyProgram" before trying again.
ERROR: Could not find bundle binary for "MyProgram.app/Contents/MacOS/MyProgram"
ERROR: file copy failed from "/Developer/Applications/Qt/plugins/platforms/libqcocoa.dylib"
ERROR: to "MyProgram.app/Contents/MacOS/MyProgram/Contents/PlugIns/platforms/libqcocoa.dylib"
ERROR: file copy failed from "/Developer/Applications/Qt/plugins/printsupport/libcocoaprintersupport.dylib"
ERROR: to "MyProgram.app/Contents/MacOS/GraphiteMiniEditor/Contents/PlugIns/printsupport/libcocoaprintersupport.dylib"
Re macdeployqt fails: it seems like, for the argument to macdeployqt you are passing the path to the executable instead of the path to the bundle. I.e. just pass .../MyProgram.app instead of .../MyProgram.app/Contents/MacOS/MyProgram.
(But I am also unable to get it find libqcocoa, in a sandboxed app. I may resort to linking that statically into my app.)
To give Kamil Klimek's solution some more attention (It solved the problem for me):
I had the same problem when I installed QtCreator (Qt 5.x) with the offline installer, but apparently also had Qt (4.x) installed through Homebrew (probably pulled in as a dependency). Compiling the code with 5.x, and deploying it with the 4.x macdeployqt script doesn't work.
So, make sure that e.g.:
which macdeployqt
calls macdeployqt from the same Qt version / path used to compile the code.
I had this error with OS X Lion, using Qt 5.4.2. When I installed the Xcode command line utilities, then the error went away and macdeployqt worked.