[Gtk-sharp-list] -pkg:gtk-sharp insteadof -r:gtk-sharp

Jonathan Pryor jonpryor@vt.edu
Fri, 28 May 2004 06:50:57 -0400

On Fri, 2004-05-28 at 02:54, Juergen Moeller wrote:
> So, now I have to compile gtk#-apps like this:
> mcs -r:/path/to/gtk-sharp.dll app.cs  or
> mcs `pkg-config --libs gtk-sharp` app.cs

Don't forget this:

	mcs app.cs -pkg:gtk-sharp

Which has mcs call pkg-config for you.

> It works... however, the old way was more elegant, I think. 

It was simpler.  It was also broken, as the old way assumed that all
assemblies (1) were in the same directory (/usr/lib) and (2) you could
only have one version of the assembly installed (as
/usr/lib/gtk-sharp.dll is only a single version).

The GAC changes both these assumptions, as GAC assemblies are stored in
/usr/lib/mono/gac/<assembly-name>/<assembly-version>, and the output of
pkg-config refers to sym-links in /usr/lib/mono/<assembly-name> (note
the missing "gac" directory).

At least, this is the situation for CVS-current.

Personally, I think this approach is still broken: how do I develop
against multiple assembly versions, say gtk-sharp 1.0 and gtk-sharp 2.0
(it will happen eventually).  Under the current approach, the output of
pkg-config can only refer to one of these versions, so we don't have a
future-proof GAC setup yet.  Alternatively, the pkg-config files could
have version numbers added, giving us gtk-sharp-1.0 and gtk-sharp-2.0 in
pkg-config, which would nicely solve the issue, though it would also
generate a strange mcs command line: mcs app.cs -pkg:gtk-sharp-1.0,
which references gtk-sharp.dll.

> Another possibility is to put the path to the gtk-sharp.dll in the 
> environment variable $MONO-PATH ! :)

This works, but it's not ideal as it doesn't properly handle the GAC.

You might try looking at the mono-devel-list archives for more on the
GAC architecture.

 - Jon