Deploying a Qt application on win7 32-bit - works (and compiles) on Win7 x64

Ok, I spent the whole day looking for a solution and read everything, but I canโ€™t deploy my Qt application, so I decided to ask.

I am using Qt 5.2.1 through a Visual Studio add-in in VS 2013 Ultimate, qt version is msvcr2012. I have a Qt version of x86 (now this is the third part at the bottom of the Qt download page).

I am targeting the 32-bit version of Win7.

My OS is 64-bit Windows7, I am creating an application for win32, release /o2 (max speed)Optimization,, /MD (dynamic C runtime)with related libraries:

qtmain.lib
Qt5Core.lib
Qt5Gui.lib
Qt5Widgets.lib
Qt5PlatformSupport.lib //this one is added by me, the others are automatically set with the Qt-AddIn template.

I create it, and in the release folder I put the following:

EDIT: due to my compiler version, I am also distributing vs2012 dll.s, as you can see.

enter image description here

.../release                                            /plugins        /platforms

I set an additional library path (only for a 100% probability of finding them):

void registerPluginsDir(QDir& exeDir)
{
QString pluginsRelPath = "plugins";
QString platformsRelPath = "platforms";
QString pluginsPath = exeDir.absoluteFilePath(pluginsRelPath);
QString platformsPath = QDir(pluginsPath).absoluteFilePath(platformsRelPath);
QStringList pathes = QCoreApplication::libraryPaths();
pathes << pluginsPath;
pathes << platformsPath;
QCoreApplication::setLibraryPaths(pathes);

for (auto i : pathes)
    qDebug() << i << "\n";
};

int main(int argc, char *argv[])
{
    QString exePath = QString::fromUtf8(argv[0]);
    QFileInfo exeInfo(exePath);
    QDir exeDir(exeInfo.absolutePath());
    registerPluginsDir(exeDir);

    QApplication a(argc, argv);
    KeyGenerator w;
    w.show();
    return a.exec();
};

. , , Qt.

depend.exe . 2 , :

Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.

DLL DLL , Visual Studio. depend.exe debug, VS- dll-s SysWOW64, system32.

() , (Win7 32- Microsoft Virtual PC) " " :

Failed to load platform plugin "windows". Available platforms are:
(and here there are the full pathes to the .dll-s, 
eg: D:\cproj\keygen\win32\Release\plugins\platforms\qwindows.dll, so it must have found them.

: http://qt-project.org/wiki/Deploy_an_Application_on_Windows.
Qt-dir, ( Qt-, ). dll- , . pac (Win7 32bit) . :

enter image description here

32- ? , release-win32, debug-win32, . , XP C-runtime, .

. .

: , dev pc. - , .

+2
2

, VS2010.
, , Qt, . , ( ) . 2012 2013 .

0

, .. Qt wiki, , , plugins, .

deployment screenshot

, , :

  • .dll Qt bin .

  • ( ) Qt plugins qml .

, . , .

, " DLL , ". , Qt 5 MSVC 2012, , Windows XP , LGPL, ( ++!).

+2

Source: https://habr.com/ru/post/1548707/


All Articles