[Help] Configure static compile with Qt 5.0.2
-
wrote on 13 Apr 2013, 17:48 last edited by
I build an GUI application based on Qt 5.0.2 in Ubuntu platfrom, then I copied the build folder into another Ubuntu machine and run it, but I got the error in terminal
bq. error while loading shared libraries: libQt5WebKitWidgets.so.5: cannot open shared object file: No such file or directory.
bq. error while loading shared libraries: libQt5Widgets.so.5: cannot open shared object file: No such file or directory
After take a look at Google, I figured out that the problem is about static compile (share library and static library). I try to do some instruction with older Qt version, but not successful.
Could everyone tell me how can I fix that problem or give me some ideas for configuring Qt 5.0.2 to be static compile? please.
thannk you so much -
Please mind the license when attempting to compile statically. LGPL is restrictive in that regard. There are other ways to deploy an application without compiling it statically (LD_LIBRARY_PATH is one of them, or waiting for distros to include Qt5 in their repos). Also, Qt 5.0.2 can cause problems when compiled statically and if your app is using QML2.
You need to tell us how "not successful" you have been. What have you tried, what were the errors you've got?
-
wrote on 14 Apr 2013, 01:27 last edited by
I'm new in Qt, I've just used to Qt for 2 weeks and I don't know it clearly. Could you please tell me how to deploy it without compile statically? How can I use LD_LIBRARY_PATH? :(
When I'm at another computer without installing Qt and try to run my simple application. I used this command to see all shared library which my program need:
@ldd MyAppName@I realize that some missing library files. I copied manually the library files (pasted them into /usr/lib/i386-linux-gnu/) from computer which has intalled Qt to the target computer and try to run the program again. Finally, all of necessary library files are available, but I got the following error:
@Failed to load platform plugin "xcb". Available platforms are: @
@Aborted (core dumped)@I need advices from you so much...
Thank you -
You need to copy the platform plugin, too (it was libqxcb.so, IIRC). And of course, install all dependencies. I'm not sure, for me it just works.
As for LD_LIBRARY_PATH - it's an env variable that tells the OS where to look for libraries. So you need to point it to where you have placed Qt libs (could be Qt installation dir, or your application's root folder - as you wish).
-
wrote on 14 Apr 2013, 09:09 last edited by
I appreciate your reply, Sierdzio
I tried and try so much, I coppied libqxcb.so into /usr/lib/i386-linux-gnu/ and trying load it in my project as well
@LIBS += "./libqxcb.so"@But I got the same error
@Failed to load platform plugin "xcb". Available platforms are: Aborted (core dumped)@
I don't know what dependencies are...
Look forward to your reply -
wrote on 15 Apr 2013, 06:25 last edited by
I copied platforms directory which contains libqxcb.so into my app folder and run my app again. It seems to realize some available platforms but cannot load it..
@Failed to load platform plugin "xcb". Available platforms are:
linuxfb
minimal
xcb@
what happen? -
wrote on 17 Apr 2013, 05:47 last edited by
I've solved this problem.
I build my own library and uses LD_LIBRARY_PATH point to it.
@Failed to load platform plugin "xcb"@
I copy platforms directory from Qt and paste it into my project folder. It works.
3/7