Re: Problems with sqlite



On Tue, 2004-12-07 at 21:37 -0600, Michael Davies wrote:
> ERROR: System.Reflection.TargetInvocationException: Exception has been
> thrown by the target of an invocation. ---> System.DllNotFoundException:
> sqlite
> in <0x00053> (wrapper managed-to-native)

This is just a guess, but the problem could be a mono-ism that has been
a source of much confusion.

The mono runtime will throw a System.DllNotFoundException any time an
attempt to dlopen() a shared library fails.  This is misleading because
there are several different ways a dlopen() call can fail --- the file
not being found is just the most obvious one.

Often, dlopen() will fail because of unresolved symbols.  This usually
happens because the shared library's dependencies were not set properly
at build-time.  It is an easy mistake to make: lots of shared libraries
are never ever dlopen()ed by other apps --- they are linked to
applications, along with lots of other libraries via a tool like
pkg-config that also (independently) manages library dependencies.

There is an easy way to test for this: try linking just that library
against a trivial C program.  Create a file trivial.c containing just
"main() { }" and then:
% gcc trivial.c -lsqlite

If there are no errors, libsqlite.so's dependencies are set correctly
and the problem must be something else.  If you see unresolved symbols,
the Ubuntu libsqlite.so is broken.

-J





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]