[Mono-list] library location problem

Daniel Carrera dcarrera@math.toronto.edu
Tue, 16 Apr 2002 12:59:58 -0400 (EDT)


> It would come in handy to be able to pass a (third) directory to mono
> where it should look for libraries. This way a user could have its own
> directory with libraries and still tell mono to _also_ look there. Also
> for testing before installing libraries this feature would come in
> handy.
>
> (or I am missing the point again ;-) )

You are not missing the point. :-)

There is already a way to solve the above problem.  In addition to the
current directory and the standard directories, Mono looks in all the
directries indicated in the LD_LIBRARY_PATH variable.

In my case, I *do* want my own library directory.  Thus, I have this line
in my .bashrc file:

LD_LIBRARY_PATH=/home/daniel/lib


Cheers,
Daniel.


On 16 Apr 2002, Christophe VG wrote:

> Hi,
>
> I have some problems with compiling/running applications with additional
> libraries.
>
> If I compile a library of my own in the current directory and next
> compile a test program in a sub directory of the current directory, all
> goes well. When I try to run this compiled testprogram mono complains
> about not able to find the library, but when I copy the .exe from the
> subdirectory to the current directory and execute it, it works.
>
> Here's an overview (probably much clearer :
>
> [ntt@taurus example]$ ls
> Test.dll    Makefile   t
>
> [ntt@taurus example]$ mcs t/test-1.cs
> t/test-1.cs(7) error CS0246: Cannot find type `ExampleModule'
> Error: Compilation failed
> RESULT: 1
> [ntt@taurus example]$ mcs -r Test.dll t/test-1.cs
> RESULT: 0
>
> [ntt@taurus example]$ mono t/test-1.exe
>
> ** (process:19394): WARNING **: Could not find assembly Test
> /usr/lib/Test.dll
> Can not open image t/test-1.exe
>
> [ntt@taurus example]$ cp t/test-1.exe .
> [ntt@taurus example]$ mono test-1.exe
> creating example object
> Test.ExampleModule::Constructor
> calling example object functionality
> Test.ExampleModule::DoSomething()
> RESULT: 0
>
> It seems that mono looks for the .dll in /usr/lib (the default location
> depending on compilation) and the current directory, but only the
> current directory relative to the source file.
>
>
> It would come in handy to be able to pass a (third) directory to mono
> where it should look for libraries. This way a user could have its own
> directory with libraries and still tell mono to _also_ look there. Also
> for testing before installing libraries this feature would come in
> handy.
>
> (or I am missing the point again ;-) )
>
> Thanks,
> Christophe VG
>
>
>