Ant: Re: Ant: Re: Ant: Re: Ant: Re: [Gtk-sharp-list] gtk-sharp.dll not working on linux because it references win32 dll's

Rafael Teixeira monoman at gmail.com
Wed Jul 20 17:10:54 EDT 2005


Hi Jost,

On 7/20/05, Jost Boekemeier <jostb2345 at yahoo.de> wrote:
> > Are you copying the Gtk# assemblies into your
> > applications directory?
> > Then an Assembly.Load() will work.
> 
> Hrm.  As I said, not on linux because the .config
> files are missing.  Copying the config files from the
> build directory into the application directory solves
> the problem, but a) why do I have to do this

Because MS didn't thought that other platforms should be supported.

> b) why only on linux

It isn't only in linux, it is also in MacOSX (there we link with
.dylibs instead) and solaris, and... any other platform that doesn't
support native windows dlls.

> c) why are these config files necessary
> at all, they contain information which shall never be
> changed, this information should go into the library
> itself, not into a user visible config file.

No it CAN'T go in the library itself because we can't make things
incompatible with ECMA and MS.NET in that point. And also it is easier
to manage building for many platforms the way it is today.

> > Depends on how you do it.  I think it should be
> > possible to check the platform, load the real dll
> once
> > and then this dll takes over.
>
> I know of no way to do that.

> Okay.  I thought that if the dynamic loader has the
> ability to patch a library when it is loaded one could
> as well check for the architecture and then load the
> byte code from the appropriate file or section.

You may suggest it to MS and ECMA, and them they could change the
format of files in version 3.x or whatever. What is available today
doesn't allow such a thing without the config file, as it needs more
information than what is available in the assembly file.

> > > As I understand it, a linux user must place a
> > dll/map
> > > pair into his library directory, while the windows
> > > user can simply copy the gtk-sharp dll's, right?
> >
> > The user shouldn't need to worry about assemblies

> He needs to, simply because he wants to load one.

So you aren't talking of a user but of a developer, because an user
would receive an installer/package that should have installed things
at the proper places so that he/she can click-around to use the
program. Users don't normally do programming. The so-called power
users might but then the IDE they MUST be using should take of such
details, and perhaps even compile things with fixed references instead
of using dynamic loading.

If you are talking about a real developer doing dynamic loading
assembly, he/she MUST know that for non-windows platforms he/she MUST
copy the dll/map pair. Period.

If you are in the "middle" of all this I would just say for you to
update your (power-)user/programmer documentation to cover this
flexibility Mono gives (to run a single managed file on many platforms
with differently named native libraries in each) but that costs
copying the mapping .config file alongside the .dll because MS/ECMA
format doesn't allow otherwise.

Good typing,

-- 
Rafael "Monoman" Teixeira
---------------------------------------
I'm trying to become a "Rosh Gadol" before my own eyes. 
See http://www.joelonsoftware.com/items/2004/12/06.html for enlightment.
It hurts!


More information about the Gtk-sharp-list mailing list