Search This Blog

Monday, June 22, 2009

Qt deployment with Qt Creator



The installation or deployment of Qt Application with shared library, it just needs to:
  1. Copy the .exe file
  2. And put the required .dll file in the same directory of your .exe file (e.g. QtCore.dll, QtNetwork.dll)
Some problems (Under Windows):

The procedure entry point _Z21qRegisterResourceDataiPKhS0_S0 could not be located in the dynamic link library QtCore4.dll

The weird thing is that QtCore4.dll is in the same directory of the .exe file. So what is the error? Just as it said, the QtCore4.dll does not contain the symbol!
Solution: make sure to copy the right QtCore4.dll
  1. Search the Qt SDK install directory, find the RIGHT QtCore4.dll
  2. In this specific example, do not get the QtCore4.dll under C:\Qt\2009.02\bin,
    but in the Qt directory. E.g. C:\Qt\2009.02\qt\bin
  3. Find the QtCore4.dll and QtGui4.dll there, and mingwm10.dll might be needed there if this is a LGPL version.
If you are using Linux/UNIX:
Try ldd command, this cool program list all the dependencies for your executable
For example, ldd your_program_ , it might output
libQtCore.so.4 => /usr/local/lib/qt4/libQtCore.so.4 (0x800648000)
libz.so.5 => /lib/libz.so.5 (0x80099e000)
libgthread-2.0.so.0 => /usr/local/lib/libgthread-2.0.so.0 (0x800ab2000)
libglib-2.0.so.0 => /usr/local/lib/libglib-2.0.so.0 (0x800bb6000)
libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x800d71000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x800f6b000)
libm.so.5 => /lib/libm.so.5 (0x801176000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x801296000)
libthr.so.3 => /lib/libthr.so.3 (0x8013a4000)
libc.so.7 => /lib/libc.so.7 (0x8014bc000)
libz.so.4 => /lib/libz.so.4 (0x8016f5000)
libintl.so.8 => /usr/local/lib/libintl.so.8 (0x801809000)
libpcre.so.0 => /usr/local/lib/libpcre.so.0 (0x801912000)

No comments: