Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-03

Strange message "Can not initialize interface sqlite" in Android

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Felipe Monteiro de Carvalho

Hello,

In a project using sqlite in Android the following happens at startup:

Show quoted text 8 lines
D/dalvikvm(31719): GC_CONCURRENT freed 6K, 52% free 2617K/5379K, external 4687K/5853K, paused 7ms+3ms I/lclapp? (31719): TApplication.HandleException Can not initialize interface sqlite from library "libsqlite3.so" I/lclapp? (31719):?? Stack trace: I/lclapp? (31719):?? $414149B8 I/lclapp? (31719): WARNING: TLCLComponent.Destroy with LCLRefCount>0. Hint: Maybe the component is processing an event?

Again I searched *.* everywhere that I could think of (lazarus/components/sqlite, fpc4android/rtl, fpc4android/packages) but I can't find any string which reads "Can not initialize interface" ... any ideas?

Also, the sqlite interface has ifdefs which seam to allow it to do either dynamic or static loading of the sqlite so, so in which cases either one is activated? Is it always static linking for linux? But if it was static, I would not expect an exception at all, so it seams to be dynamic linking, although dynamic requires a define which is not defined in code (maybe it is defined in the makefiles?)

thanks,

Felipe Monteiro de Carvalho

Reply by email

Vincent Snijders
to Felipe Monteiro de Carvalho

Op 31 maart 2012 08:45 heeft Felipe Monteiro de Carvalho het volgende geschreven:

Show quoted text 17 lines
Hello, In a project using sqlite in Android the following happens at startup: > D/dalvikvm(31719): GC_CONCURRENT freed 6K, 52% free 2617K/5379K, external > 4687K/5853K, paused 7ms+3ms > I/lclapp? (31719): TApplication.HandleException Can not initialize interface > sqlite from library "libsqlite3.so" > I/lclapp? (31719):?? Stack trace: > I/lclapp? (31719):?? $414149B8 > I/lclapp? (31719): WARNING: TLCLComponent.Destroy with LCLRefCount>0. Hint: > Maybe the component is processing an event? Again I searched *.* everywhere that I could think of (lazarus/components/sqlite, fpc4android/rtl, fpc4android/packages) but I can't find any string which reads "Can not initialize interface" ... any ideas?

./rtl/units/i386-linux/rtlconsts.rst:rtlconsts.slibrarynotloaded='Can not initialize interface %s from library'+

Vincent

Reply by email

Felipe Monteiro de Carvalho
to Vincent Snijders

Ok, thanks, so it is from rtl/inc/dynlibs.pas and LoadLibrary from rtl/unix/dynlibs.inc:

function TryInitializeLibraryInternal(var Handler: TLibHandler; const
LibraryName: String;
  const User: Pointer; const NoSymbolErrors: Boolean): Integer;
.....
  Result := InterlockedIncrement(Handler.RefCount);
  if Result = 1 then
  begin
    Handler.Handle := LoadLibrary(LibraryName);
    if Handler.Handle = NilHandle then
    begin
      AppendLibraryError(Handler, Format(SLibraryNotLoaded,
[Handler.InterfaceName, LibraryName]));

So I assume that dlopen is simply not finding the library.

Felipe Monteiro de Carvalho

Reply by email