[Interest] Problem location symbol on android
Lorne Sturtevant
dragor at shaw.ca
Thu Apr 14 00:23:27 CEST 2016
On 04/07/2016 05:15 PM, Lorne Sturtevant wrote:
> I have a project that I'm trying to get working on android. I'm
> using Qt Creator to build and run everything. The program compiles,
> links and deploys. When it runs, I get the following error:
>
> Starting remote process.V/Zygote (20264): Switching descriptor 33 to
> /dev/null
>
> V/Zygote (20264): Switching descriptor 9 to /dev/null
>
> D/dalvikvm(20264): Late-enabling CheckJNI
>
> I/ActivityManager( 436): Start proc org.qtproject.example.test_mage
> for activity
> org.qtproject.example.test_mage/org.qtproject.qt5.android.bindings.QtActivity:
> pid=20264 uid=10109 gids={50109, 3003, 1028, 1015}
>
> D/ActivityThread(20264):
> handleBindApplication:org.qtproject.example.test_mage
>
> D/ActivityThread(20264): setTargetHeapUtilization:0.75
>
> D/ActivityThread(20264): setTargetHeapMinFree:524288
>
> D/dalvikvm(20264): Trying to load lib
> /data/data/org.qtproject.example.test_mage/lib/libgnustl_shared.so
> 0x2c665238
>
> D/dalvikvm(20264): Added shared lib
> /data/data/org.qtproject.example.test_mage/lib/libgnustl_shared.so
> 0x2c665238
>
> D/dalvikvm(20264): No JNI_OnLoad found in
> /data/data/org.qtproject.example.test_mage/lib/libgnustl_shared.so
> 0x2c665238, skipping init
>
> D/dalvikvm(20264): Trying to load lib
> /data/data/org.qtproject.example.test_mage/lib/libQt5Core.so 0x2c665238
>
> D/dalvikvm(20264): Added shared lib
> /data/data/org.qtproject.example.test_mage/lib/libQt5Core.so 0x2c665238
>
> D/dalvikvm(20264): Trying to load lib
> /data/data/org.qtproject.example.test_mage/lib/libQt5Gui.so 0x2c665238
>
> D/dalvikvm(20264): Added shared lib
> /data/data/org.qtproject.example.test_mage/lib/libQt5Gui.so 0x2c665238
>
> D/dalvikvm(20264): No JNI_OnLoad found in
> /data/data/org.qtproject.example.test_mage/lib/libQt5Gui.so
> 0x2c665238, skipping init
>
> D/dalvikvm(20264): Trying to load lib
> /data/data/org.qtproject.example.test_mage/lib/libQt5Widgets.so 0x2c665238
>
> D/dalvikvm(20264): Added shared lib
> /data/data/org.qtproject.example.test_mage/lib/libQt5Widgets.so 0x2c665238
>
> D/dalvikvm(20264): No JNI_OnLoad found in
> /data/data/org.qtproject.example.test_mage/lib/libQt5Widgets.so
> 0x2c665238, skipping init
>
> D/dalvikvm(20264): Trying to load lib
> /data/data/org.qtproject.example.test_mage/lib/libQt5Xml.so 0x2c665238
>
> D/dalvikvm(20264): Added shared lib
> /data/data/org.qtproject.example.test_mage/lib/libQt5Xml.so 0x2c665238
>
> D/dalvikvm(20264): No JNI_OnLoad found in
> /data/data/org.qtproject.example.test_mage/lib/libQt5Xml.so
> 0x2c665238, skipping init
>
> D/dalvikvm(20264): Trying to load lib
> /data/data/org.qtproject.example.test_mage/lib/libQt5Concurrent.so
> 0x2c665238
>
> D/dalvikvm(20264): Added shared lib
> /data/data/org.qtproject.example.test_mage/lib/libQt5Concurrent.so
> 0x2c665238
>
> D/dalvikvm(20264): No JNI_OnLoad found in
> /data/data/org.qtproject.example.test_mage/lib/libQt5Concurrent.so
> 0x2c665238, skipping init
>
> D/dalvikvm(20264): Trying to load lib
> /data/data/org.qtproject.example.test_mage/lib/libQt5Network.so 0x2c665238
>
> D/dalvikvm(20264): Added shared lib
> /data/data/org.qtproject.example.test_mage/lib/libQt5Network.so 0x2c665238
>
> D/dalvikvm(20264): No JNI_OnLoad found in
> /data/data/org.qtproject.example.test_mage/lib/libQt5Network.so
> 0x2c665238, skipping init
>
> D/dalvikvm(20264): Trying to load lib
> /data/data/org.qtproject.example.test_mage/qt-reserved-files/plugins/platforms/android/libqtforandroid.so
> 0x2c665238
>
> D/dalvikvm(20264): Added shared lib
> /data/data/org.qtproject.example.test_mage/qt-reserved-files/plugins/platforms/android/libqtforandroid.so
> 0x2c665238
>
> I/Qt (20264): qt start
>
> D/dalvikvm(20264): Trying to load lib
> /data/data/org.qtproject.example.test_mage/qt-reserved-files/plugins/bearer/libqandroidbearer.so
> 0x2c665238
>
> D/dalvikvm(20264): Added shared lib
> /data/data/org.qtproject.example.test_mage/qt-reserved-files/plugins/bearer/libqandroidbearer.so
> 0x2c665238
>
> D/dalvikvm(20264): No JNI_OnLoad found in
> /data/data/org.qtproject.example.test_mage/qt-reserved-files/plugins/bearer/libqandroidbearer.so
> 0x2c665238, skipping init
>
> D/dalvikvm(20264): Trying to load lib
> /data/app-lib/org.qtproject.example.test_mage-2/libphysfs.so 0x2c665238
>
> D/dalvikvm(20264): Added shared lib
> /data/app-lib/org.qtproject.example.test_mage-2/libphysfs.so 0x2c665238
>
> D/dalvikvm(20264): No JNI_OnLoad found in
> /data/app-lib/org.qtproject.example.test_mage-2/libphysfs.so
> 0x2c665238, skipping init
>
> D/dalvikvm(20264): Trying to load lib
> /data/app-lib/org.qtproject.example.test_mage-2/libmage.so 0x2c665238
>
> E/dalvikvm(20264):
> dlopen("/data/app-lib/org.qtproject.example.test_mage-2/libmage.so")
> failed: dlopen failed: cannot locate symbol
> "_ZN18QXmlDefaultHandlerC2Ev" referenced by "libmage.so"...
>
> The constructor for QXmlDefaultHandler is not found. It looks like
> it's loading the libQt5Xml.so library fine though. When I examine the
> library in the build directory, this is what I get:
> $ objdump -T libQt5Xml.so | grep _ZN18QXmlDefaultHandlerC2Ev
> 000121b9 g DF .text 00000038 _ZN18QXmlDefaultHandlerC2Ev
>
> The symbol is in the library, but I have no idea why it's not finding it.
>
> Any help with this would be greatly appreciated.
I figured out what the problem was. I'm just replying to this in case
anyone else comes across this problem.
It seems the linker acted a little different on Android compared to all
the other platforms I used. When linking libmage.so, I had to add
"-lQt5Xml -lgnustl_shared" to the command line. I actually had to add
all of the Qt libraries that libmage.so used, but Qt5Xml is what
specifically fixed the error finding the symbol _ZN18QXmlDefaultHandlerC2Ev.
I should also note that I am using autotools to create libmage.so and
not QtCreator. I'm sure QtCreator would have setup the linking for me
without this problem.
--
Lorne Sturtevant
Sum Ergo Cogito
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160413/d34ad954/attachment.html>
More information about the Interest
mailing list