embed .so.1 library

39 views
Skip to first unread message

Mériadeg Perrinel

unread,
Oct 21, 2014, 11:05:37 AM10/21/14
to andro...@googlegroups.com
HI,

I need to know if it's possible to embed expat lib in Android using qmake.
Compile expat for android provides three so files:
libexpat.so
libexpat.so.1
libexpat.so.1.6.0
Both of libexpat.so and libexpat.so.1 link to the third one libexpat.so.1.6.0

When another lib (that we call mylib.so) needs libexpat, ndk-expend tell it needs libexpat.so.1
In the .pro, using ANDROID_EXTRA_LIBS, I can provide only .so files
I have tried different combinaisons like remove libexpat.so, libexpat.so.1 and mv libexpat.1.6.0 to libexpat.so,
but every time, myLib say that he needs libexpat.so.1

The dependancies of mylib with libexpat is done with libexpat.so lib.

So how can I solve this ?
a) embed the libexpat.so.1 and libexpat.so.1.6.0 in the apk ?
b) succes to ask mylib depends on libexpat.so instead of libexpat.so.1

Thanks in advance

Mériadeg Perrinel

unread,
Oct 22, 2014, 11:55:01 AM10/22/14
to andro...@googlegroups.com

Hi again,

Still in difficulty with my lib.
I finaly find a easy way to send the libexpat.so.1 and libexpat.so.1.6.0 to the device using adb push.
But the new question is where can I push them ?
The public access seems to be somewhere in this path : /sdcard/Android/
Qt Creator or adb ? send my application in /data/data directory where I don't have any access.

How can I solve that now ?
How can I specify to QtCreator or adb install to install the apk in /sdcard/Android/ path ?

Marco Bernasocchi

unread,
Oct 22, 2014, 11:56:50 AM10/22/14
to andro...@googlegroups.com
this Is how I use expat in qgis for android:
https://github.com/qgis/QGIS-Android/blob/master/patches/expat.patch

ciao
--
You received this message because you are subscribed to the Google Groups "android-qt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-qt+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
Marco Bernasocchi
opengis.ch - berna.io - 27summits.ch

Mériadeg Perrinel

unread,
Oct 22, 2014, 3:06:11 PM10/22/14
to andro...@googlegroups.com
Hi Marco and thanks for the answer.

The patch seems to remove the major part of the expat lib name at its compilations.
That could be a nice really nice patch for me that I'll test.

Can you confirm that if you do a ndk-depends on your library that link on expat lib you will see its depends on libexpat.so instead of libexpat.so.1 ?
Furthermore, I have the same problem with gdal :)

Mériadeg Perrinel

unread,
Oct 23, 2014, 9:47:29 AM10/23/14
to andro...@googlegroups.com
Hi,

The patch works for two Hunk (the second and the third)  with the expat version coming from 2.1.0 source.
But it's enough to get only a .so instead of the 1.6.0 (The first one and the fourth are probably not necessary with the last source)
Thanks a lot, I'll try your gdal patch too

Meriadeg

Mériadeg Perrinel

unread,
Oct 24, 2014, 11:22:48 AM10/24/14
to andro...@googlegroups.com
Hi again,

To conclude here, the gdal patch works fine too, so my problem is solved.

Thanks again,

Meriadeg

Marco Bernasocchi

unread,
Oct 24, 2014, 2:03:57 PM10/24/14
to andro...@googlegroups.com

I knew ;)
Just in case, I set up a sort of osgeo4android repo at
http://qgis.org/downloads/android/repository/

You can use it as a ministro source.
Ciao
Marco Bernasocchi (mobile)
http://opengis.ch

Reply all
Reply to author
Forward
0 new messages