Bug 199 - gtk#, error at run-time when compile old solutions on lion with the mono 2.10.3 on MAC OS LION
Summary: gtk#, error at run-time when compile old solutions on lion with the mono 2.10...
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: General ()
Version: unspecified
Hardware: PC Mac OS
: --- critical
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2011-08-05 12:44 UTC by Ricardo
Modified: 2011-08-16 04:32 UTC (History)
4 users (show)

Tags: gtk# on Mac OS Lion
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Ricardo 2011-08-05 12:44:04 UTC
I update my MacBook to Mac OS X Lion. Downloaded and installed the mono 2.10.3 and try to compile my old soluctions and can't compile anyone that use Gtk#. 

I created a small application like follow bellow and refereces the assembly Gtk-Sharp 2.12 at the project:



using System;
using Gtk;

namespace StartGtk
{
	class MainClass
	{
		public static void Main (string[] args)
		{
			
			Application.Init ();
			Window win = new Window ("Teste");
			win.Show (); 
			Application.Run ();
			
		}
	}
}


Here is the error:


Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for Gtk.Container ---> System.DllNotFoundException: gtksharpglue-2
  at (wrapper managed-to-native) Gtk.Container:gtksharp_gtk_container_get_focus_child_offset ()
  at Gtk.Container..cctor () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at Gtk.Bin..ctor (IntPtr raw) [0x00000] in <filename unknown>:0 
  at Gtk.Window..ctor (WindowType type) [0x00000] in <filename unknown>:0 
  at Gtk.Window..ctor (System.String title) [0x00000] in <filename unknown>:0 
  at StartGtk.MainClass.Main (System.String[] args) [0x00000] in /Users/ricardo/Projects/StartGtk/StartGtk/Main.cs:10 
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: An exception was thrown by the type initializer for Gtk.Container ---> System.DllNotFoundException: gtksharpglue-2
  at (wrapper managed-to-native) Gtk.Container:gtksharp_gtk_container_get_focus_child_offset ()
  at Gtk.Container..cctor () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at Gtk.Bin..ctor (IntPtr raw) [0x00000] in <filename unknown>:0 
  at Gtk.Window..ctor (WindowType type) [0x00000] in <filename unknown>:0 
  at Gtk.Window..ctor (System.String title) [0x00000] in <filename unknown>:0 
  at StartGtk.MainClass.Main (System.String[] args) [0x00000] in /Users/ricardo/Projects/StartGtk/StartGtk/Main.cs:10
Comment 1 Jeffrey Stedfast 2011-08-05 15:56:35 UTC
I don't seem to be able to reproduce this with MonoDevelop 2.6b3 and MonoFramework-MDK-2.10.3_3.macos10.xamarin.x86.dmg

Which MonoFramework .dmg did you install? ANd what version of MonoDevelop?

I am wondering if maybe you installed the MRE instead of the MDK?
Comment 2 Ricardo 2011-08-05 17:04:02 UTC
Yes, just like mine. 

I'm using the same configuration.

When I create a new soluction that is Gtk# type it works, but if I create an console application and references Gtk# Assembly it will throw the exception.
Comment 3 Jeffrey Stedfast 2011-08-05 17:14:55 UTC
Okay, now I can reproduce. Probably MonoDevelop isn't setting the right environment? I dunno.
Comment 4 Ricardo 2011-08-06 06:49:50 UTC
I think that the new package is miss something, because the soluction compile perfect, if you compile the soluction and run it from prompt using the mono runtime the error is throw.
Comment 5 Jeffrey Stedfast 2011-08-08 14:42:03 UTC
The issue seems to be an environment issue.

This should fix it:

export DYLD_FALLBACK_LIBRARY_PATH=/Library/Frameworks/Mono.framework/Versions/Current/lib:/lib:/usr/lib

If you are having problems building/running your app from MonoDevelop, that's probably a MonoDevelop bug.

Which version of MonoDevelop are you using?
Comment 6 Ricardo 2011-08-09 08:39:01 UTC
I'm using monodevelop 2.6b but I downgrad to 2.4.2 (stable) to test, but the same problem was showed. 


on prompt shell I set the DYLD_FALLBACK_LIBRARY_PATH variable like you sayed  and mono works. 

a) I compiled the application on monodevelop 
b) Open the terminal
c) set the variable like you teach to do 
d) mono StartGtk.exe (so it works)


Like you sayed it is something about the environment!
Comment 7 Ricardo 2011-08-11 08:41:13 UTC
I put the variable export
DYLD_FALLBACK_LIBRARY_PATH=/Library/Frameworks/Mono.framework/Versions/Current/lib:/lib:/usr/lib  on /etc/prifile and monodevelop works too.


thanks Jeffrey Stdfast!
Comment 8 Ricardo 2011-08-11 08:42:06 UTC
(In reply to comment #7)
> I put the variable export
> DYLD_FALLBACK_LIBRARY_PATH=/Library/Frameworks/Mono.framework/Versions/Current/lib:/lib:/usr/lib
>  on /etc/profile and monodevelop works too.
> 
> 
> thanks Jeffrey Stdfast!
Comment 9 Lluis Sanchez 2011-08-16 04:32:30 UTC
Closing.