[Mono-list] Added dll to gac not being picked up

Jonathan Pryor jonpryor at vt.edu
Tue Aug 8 07:42:38 EDT 2006

On Tue, 2006-08-08 at 12:11 +0100, PFJ wrote:
> I've rewritten the spec file for db4o to now add the db4o.dll to gac
> The problem comes when I try to link to db4o. All I get back is that the
> db4o assembly cannot be found. I'm using 
> mcs db4oexample.cs -r:db4o.dll (I've also tried Db4o.dll and not adding
> the -r:db4o)
> Am I doing something wrong or is there a missing bit to the equation?

Both.  You can't use -r to reference assemblies within the GAC.

-r can only be used to reference: full path names, files in the current
directory, files in a directory specified by -L, and files in the same
directory as mcs.exe/gmcs.exe (which is how mscorlib.dll, System.dll,
etc. are found).

You need to create a pkg-config file with a Libs: statement adding -r:
references for files under %{buildroot}%{monodir}/db40, e.g.


	Name: db4o
	Description: TODO
	Version: TODO
	Libs: -r:${libdir}/mono/db4o/db4o.dll

Then you can use -pkg:db40 on your mcs compile line to implicitly add
-r:/usr/lib/mono/db4o/db4o.dll to the mcs command line, which should
allow your code to properly compile.

You should investigate how Gtk# does things (which is what I described

 - Jon

More information about the Mono-list mailing list