<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
This is Carlos Quiros.<br>
<br>
I am working on a mobility GPS plugin. For this I am playing around
loading libraries. I created the library with the same Necessitas QT
creator that I use in the testing example. So I create this library
libIMPInterface.so. This has the following pro:<br>
<br>
<i>QT += sql<br>
TARGET = $$qtLibraryTarget(Interface)<br>
TEMPLATE = lib<br>
SOURCES += \ <br>
../../interfaces.cpp<br>
HEADERS += ../../interfaces.h<br>
INCLUDEPATH += ../../ <br>
DESTDIR = /sdcard/Android/data/org.ilri.GPSTest</i><br>
<br>
<br>
Note:<br>
DESTDIR for now is fixed... Because is a test<br>
<br>
I saw that QApplication.java load the QT libraries using: <i>System.load(libraries[i])
</i>So as an example I added my custom library like:<br>
<br>
<i>try<br>
{<br>
System.load("/sdcard/Android/data/org.ilri.GPSTest/libInterface.so");
//This is fix... I am just testing loading my GPS library!<br>
}<br>
catch (SecurityException e)<br>
{<br>
Log.i(QtTAG, "Can't load '" + "'", e);<br>
}<br>
catch (Exception e)<br>
{<br>
Log.i(QtTAG, "Can't load '" + "'", e);<br>
}</i><br>
<br>
But I am getting the following error:<br>
<br>
<i><b>D/dalvikvm( 292): Trying to load lib
/sdcard/Android/data/org.ilri.GPSTest/libInterface.so 0x44edea38<br>
I/dalvikvm( 292): Unable to
dlopen(/sdcard/Android/data/org.ilri.GPSTest/libInterface.so): Cannot
load library: load_segments[907]: 33 failed to map segment from
'libInterface.so' @ 0x80b00000 (0x00003e28). p_vaddr=0x00000000
p_offset=0x00000000</b></i><br>
<br>
And then of course I get:<br>
<br>
<i><b>E/AndroidRuntime( 292): java.lang.UnsatisfiedLinkError: Library
/sdcard/Android/data/org.ilri.IMPACTLight/libIMPInterface.so not found</b></i><br>
<br>
<br>
Any idea what I am doing wrong? Do the libraries need to have any
special signature/form for the Dalvik VM to load them? Or I cannot use
Necessitas QT creator to make libraries?<br>
<br>
Many thanks guys and girls!<br>
<br>
Carlos.<br>
</body>
</html>