[SOLVED] Libs for Android not found
-
I am trying to build a simple Qt5 Gui application for Android using sqlite3. As soon as I add
@LIBS += -lsqlite3@I get the following errormessage:
@/home/user/Documents/android-ndk-r8e/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86/arm-linux-androideabi/bin/ld: cannot find -lsqlite3
collect2: error: ld returned 1 exit status
make: *** [libSQL.so] Error 1
09:32:45: The process "/usr/bin/make" exited with code 2.@
If I try to build the project as a desktop application, everything goes just fine.
I have no clue how to fix this, any help highly appreciated. -
Hi and welcome to devnet,
Either sqlite3 for android can't be found or you don't have it built for android. Check if you can find it and add the path to your pro file.
-
Thank you for the response.
How can I build sqlite3 for android? I wanted to do that, but I could not found intructions on how to do it. -
I tried to build sqlite3 for android using this instruction:
https://github.com/lookout/sqlite-androidI think it worked, but how can I add the path to it? Where should I place the files which were created?
-
You can either put it the correct lib folder of the NDK, or add
@-L/Path/to/your/sqlite3/library@
In your pro file
-
Setting the path did not change anything. I added the files sqlite3.h and sqlite3.c directly to the project, that seems to help. Does not look like the proper solution, though.
I also need to include expat and expatmm:
http://expat.sourceforge.net/
Any idea about how to build these for android?
Thanks in advance. -
You'll need to cross-compile them for android
-
I tried to figure out how to cross-compile the library, but I did not have success. Could you provide me with a link to a website or an explanation of how to exactly cross-compile something like the expat library?
Thank you so much. -
Are you thinking of something like "this":https://github.com/android/platform_external_expat ?
-
In case anybody is interested:
I did not manage to cross-compile the library, but I realized that Qt includes Sqlite3 and a XML parser, which was all I needed. I ended up rewriting the old code and removed the external libraries, so now I hopefully won't have to care about platform-specific libraries anymore.Thanks for the help!