Error: libQtSql.so.4 on embedded system
I want to run an application which runs and connects with a database on embedded linux. (TI AM3358)
When I try to cross-compile the Qt-code I get the following error:
error while loading shared libraries: libQtSql.so.4: cannot open shared object file: No such file or directory
I started to look online for this file. I found it here: http://www.rpmfind.net/linux/rpm2html/search.php?query=libQtSql.so.4
I downloaded the first file. After I extracted it and copied to /usr/lib/libQtSql.so.4.
When I try to compile the code I get the following error:
error while loading shared libraries: libQtSql.so.4: internal error
Isn't this the correct file? Or should I first compile this somehow?
As you can see, I'm a beginner ;).
Thanks in advance,
What Linux distribution is your target running ?
How did you cross-compile Qt ?
Thanks for the reply.
So, Linux distribution of the target: Embedded Linux --> output of uname -a
Linux goembed 3.2.0 #1 Sat Oct 14 10:02:32 CST 2017 armv7l GNU/Linux
I'm using the image from from the vendor GOEMBED. I have builded the image it with buildroot. (all info of the image can be found here: http://www.goembed.com/index.php/Community/post/tpoId/127)
On the embedded system, when I navigate to /usr/lib I get the following libraries:
After I just added :
So Qt was builded when building the image with buildroot. But I was missing this library.
@TMJJ you need to build the sql lib exactly as you built the other Qt libs.
otherwise it will 99% crash ;)
Oooh that's a pitty! I was affraid of this.
So I need to find a way to add this library to buildroot, so I can recompile it completely.
Talk to GoEmbed support, request the toolchain for this Linux you are using, download and configure.
Then sync the Qt4.8.6 repository:
$ git clone -b v4.8.6 https://code.qt.io/cgit/qt/qt.git qt4.8.6
Using the toolchain you downloaded, perform cross-compiling, when you finish copying the library libQt4Sql * to the card.
This would be a way if GoEmbed support does not have a version with libQt4Sql ready.
Here's the Readme of how to cross-compile in the SQL part:
./configureand see the options to enable SQL support:
-qt-sql- <driver> ... Enable to SQL <driver> in the QtSql library, by default -plugin-sql- <driver> Enable SQL <driver> as a plugin to be linked to [db2 ibase mysql oci odbc psql sqlite sqlite2 sqlite_symbian symsql tds]
Just case: the latest version of Qt 4 is Qt 4.8.7.