Error while running qt application on board
Hi,
I have developed a application in Qt which works fine on Linux & Windows PC. now, I cross compiled it for a board (EM2440).
When I run it, it throws following error.
************************************************** ***
error while loading shared libraries: libQtGui.so.4
: cannot open shared object file: No such file or directory
************************************************** ***
I have used "static" flag with "configure" command while cross compiling qt(v4.6.3) source. I do not know why it uses shared library. How to get rid of this?
Thanks for help in advance.
Re: Error while running qt application on board
I've noticed this as well. I believe to statically link the libs you need to run your app, that first you would need to compile the Libraries statically. This has worked for a plugin that I use with my embedded app. In my plugin .pro file (separate directory), I have the following:
TEMPLATE = lib
CONFIG += plugin \
static
HEADERS = xxxxdriverplugin.h \
xxxxbrdhandler.h
SOURCES = xxxxbrddriverplugin.cpp \
xxxxkbrdhandler.cpp
TARGET = xxxxkbrddriverplugin
DESTDIR = kbddrivers
and when I cross compile the plugin, I get a file with a ".a" extension created in the kbddrivers directory. Note the xxxx's are to protect the name of the actual project that I'm on.
i then "cd" over to the main app directory and do a cross-compile which then pulls the ".a" file into the main app. Here are the important parts of the main app's .pro file:
CONFIG += static
LIBS += -L../xxxxkbrdplugin/kbddrivers \
-lxxxxkbrddriverplugin
I'm able to transfer the cross compiled app onto the target and run. NOW, as for the Qt libs, I still need them (the ".so" files ). What I'm getting at is (as implied above), you may need a ".a" versions of the Qt libs your trying to statically link to your app. Hope this helps.
c_&_c