After assembling the project release, transfer the exe file to a separate directory. I threw all the dll that he asked for to run. As a result, at startup it gives an error:

This is a Qt platform plugin "windows".

How to get rid of it? How to compile correctly?

    2 answers 2

    You need to create the platforms folder in the program folder and copy qwindows.dll there

    main add

     QStringList paths = QCoreApplication::libraryPaths(); paths.append("."); paths.append("imageformats"); paths.append("platforms"); paths.append("sqldrivers"); QCoreApplication::setLibraryPaths(paths); 

    Here everything is described in detail http://habrahabr.ru/post/188816/

      I recommend using the environment variable QT_DEBUG_PLUGINS=1 , i.e. in Windows cmd execute the following commands:

       set QT_DEBUG_PLUGINS=1 myQtApp 

      Then Qt will write where it tries to look for the plugin and a detailed description of the errors.

      With me (Qt 5.5, Windows 7 Pro), he tried to look for a plugin in the current directory in the platforms folder. I put it there. After that it worked without changing the code and any other changes.