views:

119

answers:

1

I installed mono in Mac OS X. I was following these instructions on the mono website. The first console application worked because it didn't use any packages. However, when I ran gmcs hello.cs -pkg:gtk-sharp-2.0, it told me I didn't have pkg-config installed. So I installed pkg-config. Now I get this error because pkg-config doesn't know the mono package path:

Perhaps you should add the directory containing `gtk-sharp-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk-sharp-2.0' found
error CS8027: Error running pkg-config. Check the above output.

Where is the mono package path and what do I need to add to .bash_profile to make it so that Mono can find the packages?

+1  A: 

Well it depends on the location of mono. Just locate it from the console using "which mono", which will give you something like /opt/local/bin/mono (if you did use macports). The PKG_CONFIG_PATH then corresponds to /opt/local/lib/pkgconfig/. You could also start find /opt/local/ -name "mono.pc" and see which path is revealed. If you have absolutely no clue where mono resides (/Developer/Library/Framework might be a good guess, too) use the find command with "/" as path.

FFox
Using your advice I found the files in `/Library/Frameworks/Mono.framework/Versions/2.6.7/lib/pkgconfig`
None