Mono mac packager doesn't work with gdiplus.dll - mono

I am making a desktop app with MonoMac that relies on system.drawing. This works fine within MonoDevelop, but the created .app package doesn't.
I get this exception:
System.DllNotFoundException: gdiplus.dll
Now, there are many references to this particular problem around the web, one of the more recent ones here: http://bugzilla.xamarin.com/show_bug.cgi?id=3263.
However, I have been unable to get it working. I can copy libgdiplus.dll.dylib from the lib folder into the MonoBundle folder of my app which gets me a bit further. Setting MONO_LOG_LEVEL to debug now tells me this:
Mono: DllImport error loading library 'dlopen([app]/Contents/MonoBundle/libgdiplus.dll.dylib, 9): Library not loaded: /Library/Frameworks/Mono.framework/Versions/2.10.9/lib/libglib-2.0.0.dylib
Referenced from: [app]/Contents/MonoBundle/libgdiplus.dll.dylib
Reason: image not found'.
I've copied libglib-2.0.0*.dylib in there as well. This doesn't help because it's searching in the Library/Frameworks/... folder. I've tried to add a dllmap entry both to the config file in the MonoBundle folder, as well as in a libgdiplus.dll.dylib.config file (and libgdiplus.dll.config). These seem to be ignored because I keep getting that same error.
Where do I go from here?

I'd probably suggest switching to using MonoMac.CoreGraphics instead of System.Drawing as the best solution. WinForms APIs weren't really considered for MonoMac apps (other than System.Drawing.Color and System.Drawing.RectangleF, and SizeF).
Could you submit a bug report about this to http://bugzilla.xamarin.com? Either I or Sebastien will need to look into ways to solve this problem in the long-term. I can't promise how long you might have to wait for a solution, though, so you really should consider using CoreGraphics.

Related

Library failed to load 'dll' in LabVIEW

I want to use this project face_eye_detection.zip.
When I run it I get an error 'library failed to load',
So I changed the dll link
but the problem remains the same, I even change the dll link and it doesn't work.
Where exactly is the problem? In the link above, the program worked well with the others
Double check that it is a c++ dll and not a dotnet dll, that one has got me before.

.NET Core .dll cannot find or open the symbol file

I'm currently doing a small CLI app in .NET Core, working with VSCode. I'm getting a really strange message however, when i run debugging:
Loaded '/usr/share/dotnet/shared/Microsoft.NETCore.App/1.1.0/System.Runtime.dll'. Cannot find or open the symbol file.
Loaded '/usr/share/dotnet/shared/Microsoft.NETCore.App/1.1.0/mscorlib.dll'. Cannot find or open the symbol file.
Loaded '/usr/share/dotnet/shared/Microsoft.NETCore.App/1.1.0/System.Linq.dll'. Cannot find or open the symbol file.
Loaded '/usr/share/dotnet/shared/Microsoft.NETCore.App/1.1.0/System.Collections.dll'. Cannot find or open the symbol file.
Loaded '/usr/share/dotnet/shared/Microsoft.NETCore.App/1.1.0/System.Console.dll'. Cannot find or open the symbol file.
Loaded '/usr/share/dotnet/shared/Microsoft.NETCore.App/1.1.0/System.Runtime.Extensions.dll'. Cannot find or open the symbol file.
That said, the code runs just fine, I am just scratching my head, wondering what in the world this means then, because to me it seems like some environment variables must be wrong, as it looks like the right dll's can't be found. Yet, at the same time, it says: "loaded " so it's not the DLL?
This just means that the debugger couldn't find debugging information for the listed libraries. This should not cause any issues for you (as long as you don't need to step into those libraries, which you almost never do).

regsvr32 Custom ocx file not Registering

I've been asked to install an old VB program on an XP computer, but when I do I get an error when I run the program saying that Component 'filename.ocx' or one of its dependencies is not correctly registered: a file is missing or invalid.
This is a custom file (I did not create it), I have tried regsvr32 and I get no error messages but no successfully registered messages either.
This program also runs on another computer which this ocx file is not registered but opens without error. So my question would be what could cause the file to not be recognized by regsvr32, and run on another client with the same os, but without error. Any ideas, or new paths to look into would be very helpful.
Also if you dislike something about this question, let me know what it is, so I can fix it in the future. Down voting a question gives me no insight on why this upsets the community, it just discourages me to want to help others in areas I do understand.
If you do get the error "Component 'filename.ocx' or one of its dependencies is not correctly registered: a file is missing or invalid" from a custom dll or ocx file, it may just need that file and its dependent files in the directory that your running the executable, as was the problem in my case.
After adding the file to the root directory, and not registering any files the program opened fine. Maybe this helps someone else.

RNCryptor Dyld Error Message: Library not loaded

So, I've tired everything to get this to work after I've archived the application, but it keeps failing to open with the error message:
Dyld Error Message:
Library not loaded: /Library/Frameworks/RNCryptor.framework/Versions/A/RNCryptor
Referenced from: /Users/USER/Desktop/Project.app/Contents/MacOS/Project
Reason: image not found
I've added the Framework to the Copy Files Build Phase, I've changed the Runpath Search Paths to #loader_path/../Frameworks and the Framework Search Path to #executable_path/../Frameworks and it still doesn't want to open.
It opens fine in Xcode itself, but as soon as it's archived, it complains and doesn't run.
Any help is much appreciated :)
Ok, so I was able to fix it.
So the application was actually looking for the Framework in /Library/Frameworks/ on my Mac, I originally had thought it was looking for a reference in my actual .app file.
To fix it I opened up Terminal, cd' into the folder containing a copy of RNCryptor.framework and used this command
install_name_tool -id #executable_path/../Frameworks/RNCryptor.framework/RNCryptor RNCryptor.framework/RNCryptor
Then removed the old framework from the Xcode Project and re-inserted it using the Framework I just used from the directory I cd' into, and added the new Framework to the Copy Files Build Phase.
And voila, it worked :)

Using a framework in a PreferencePane

i am currently trying to implement a "third party framework" (FeedbackReporter.Framework) into my preferencepane.
Unfortunately I am getting the following error all the time when trying to launch my preference pane:
16.05.10 23:13:30 System Preferences[32645] dlopen_preflight
failed with
dlopen_preflight(/Users/me/Library/PreferencePanes/myPane.prefPane/Contents/MacOS/myPane):
Library not loaded:
#executable_path/../Frameworks/FeedbackReporter.framework/Versions/A/FeedbackReporter
Referenced from:
/Users/me/Library/PreferencePanes/myPane.prefPane/Contents/MacOS/myPane
Reason: image not found for
/Users/me/Library/PreferencePanes/myPane.prefPane
As far as I read so far, this problem is probably caused because my prefPane is no actual app, but a "plugin" of "System Settings.app" and thus #executable_path resolves to a path within the bundle of this app, instead of the bundle of my prefpane.
But I don't really picked up howto fix this problem. I guess it must be fairly easy since it should be a usual case that people use non-apple-frameworks in PreferencePanes.
Thanks for your hints!
--
Short Update:
As far as I understood tons of docs I read so far, there might be a setting which has to be done in the third-party framework. Obviously the "install path" has to be set to "loader_path" instead to "executable_path" in order to work in a preferencepane.
But since I am using a precompiled framework (FeedbackReporter.framework) this is probably a setting which the author has to change?! and even if i could compile the framework myself, i had no idea where to change this install_path in Xcode.
If you cannot wait for the next release just download the source, change it in
FeedbackReporter.xcodeproj/project.pbxproj
and then open and compile the framework yourself.
Actually, you can change it yourself without recompiling the third party framework. You can use install_name_tool to change where a MachO binary will look for shared object libraries. First use otool -L <binary file for your plugin> to get the paths of where it expects its libraries to be, then use install_name_tool -change ... to change the paths in that file. Repeat for any bundled frameworks.