I have a program on .NET 4 for Windows. I'm trying to port it for Mac computers with mono and Xamarin studio.
I have third-part library EmguCV (it's a wrapper for OpenCV library). I'm using official manual to install it. It installs both OpenCV and EmguCV to
Library/Python/2.7/site-packages/emgucv/lib
When I start program in Debug mode from Xamarin - all works fine. It founds all libraries and use it. But when I make program as "pak" and run on computer without installed EmguCV - I got "DLL not found" exception.
I make my program with this command:
macpack -m:1 -o:. -r:/Library/Frameworks/Mono.framework/Versions/Current/lib/ -r:/Library/Python/2.7/site-packages/emgucv/lib -r:/Library/Python/2.7/site-packages/emgucv/bin -r:Assimp32.dll -r:Assimp64.dll -r:cvextern.dll -r:Emgu.CV.dll -r:Emgu.Util.dll -r:libegl.dll -r:libglesv2.dll -r:OpenTK.dll -r:OpenTK.GLControl.dll -r:RH.AssimpNet.dll -r:RH.HeadEditor.dll -r:RH.ImageListView.dll -r:RH.HeadShop.exe -r:blending.fs -r:blending.vs -r:blendingPl.vs -r:idle.fs -r:idle.vs -r:skelet.vs -r:sprite.png -r:./Libraries -r:./Models -r:./Plugin -r:./Resources -r:./Stages -r:./"Haar Cascades" -n:HeadShop -a:RH.HeadShop.exe
My second and third params should attached EmguCV libraries to my pak:
And when I'm looking inside pak - I find this libraries. However the program still not found it..
I guess trouble in openCV native libraries, but I can't realize what is wrong :(
Well, I spent a lot of time on mac forums :)
The point is that OSX dynamic libraries (*.dylib) have an "install name" that tells the OS where the library expects to be found.
So, to work with it - I should change "install name". To do it - I used a tool dylibbundler that changed this name with install_name_tool like this:
install_name_tool -id "@loader_path/dylibs/libcvextern.dylib" libcvextern.dylib
where @loader_path is a special Mac variable, which allows to use relative to application path.
These are the things I'd check first. 1. Is your pak complete. Sounds like you may have already checked that. 2. Does your test system have the opencv binaries installed and in the path.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With