[Mono-osx] Environment variables not set up properly

bmahf bmahf at hotmail.com
Tue May 4 15:21:26 EDT 2010


Yes, when I said I backed out of the macports thing, I meant I had
uninstalled mono using the macports port command.  Far as I know, there are
no longer any binaries on the system for mono that were put there by
macports.  Which mcs gives me /usr/bin/mcs which is as you said a symlink to
/Library/Frameworks/Mono.framework/Commands/mcs.  Same for mono, etc. 
That's actually where I was before I sent that post.  I just changed my
.bash_profile and commented out all of the entries in there that I had set
to get mono going.  Now I have a small hello.cs:

using System;
using Gtk;

public class HelloWorld
{
  static public void Main ()
  {     
    Application.Init();
    Window window = new Window("helloworld");
    window.Show();
    Application.Run();
  }     
}

and I tried compiling on the command line with:

mcs -pkg:gtk-sharp-2.0 hello.cs

and I got the error:

Package gtk-sharp-2.0 was not found in the pkg-config search path.

I did a "which pkg-config" and found it is in /opt/local/bin, which is where
macports was putting its stuff, so I went back to my .bash_profile file and
added the lines:

MONO_PREFIX=/Library/Frameworks/Mono.framework/Versions/Current
export PKG_CONFIG_PATH=$MONO_PREFIX/lib/pkgconfig

That worked.  It compiled!  But running with "mono hello.exe" gives the
following:

Unhandled Exception: System.DllNotFoundException: libgtk-quartz-2.0.0.dylib
  at (wrapper managed-to-native) Gtk.Application:gtk_init (int&,intptr&)
  at Gtk.Application.Init () [0x00000] in <filename unknown>:0 
  at HelloWorld.Main () [0x00000] in <filename unknown>:0 

I am assuming there is another path that is unknown, so I tried adding this
to my .bash_profile:

export
DYLD_LIBRARY_FALLBACK_PATH=$MONO_PREFIX/lib:$DYLD_LIBRARY_FALLBACK_PATH

But now it sources fine, but when I either try compiling or running with the
same lines I gave above, it gives me the following error and does what it
did before (mcs compiles well, and mono gives the dll not found exception):

dyld: warning, unknown environment variable: DYLD_LIBRARY_FALLBACK_PATH

So it seems to be getting better, but there are still issues.  I'm surprised
no one else ran into this.  Is it possible macports really messed me up?  Is
there a way that I can tell macports to COMPLETELY uninstall?

Thanks for all your help.  I can't wait to get through this so I can start
being productive...
Bruce


-- 
View this message in context: http://mono.1490590.n4.nabble.com/Environment-variables-not-set-up-properly-tp2122429p2126181.html
Sent from the Mono - OSX mailing list archive at Nabble.com.


More information about the Mono-osx mailing list