I just started learning Qt. Wrote a simple (elementary) test program:

int main() { QString string = QString("It is QString!"); cout << string.toStdString() << endl; return 0; } 

In the clion editor, it runs normally (displays "It is QString!") But when I try to run the exe file, an error occurs:

The entry point to the _ZdaPvj procedure was not found in the DLL ... \ Qt5Cored.dll

How to fix it?

  • 3
    You should not try to run the debug build (this is indicated by the suffix d in the end of the library name). In general, read about deploying Qt applications, for example: doc.qt.io/qt-5/windows-deployment.html - Bearded Beaver

3 answers 3

In the directory with Qt (not QtCreator, namely Qt of the required version) in the bin folder there is a utility windeployqt.exe. Run it, and it will copy the necessary files:

 windeployqt.exe "путь_к_exe_файлу_приложения". 

Details about the deployment of qt-applications: https://habrahabr.ru/post/262211/

    In the current directory, place the qt-th dll of your version: the OS finds a different version of the dll and uses them.

      Rather, for debug builds like this:

      windeployqt.exe --debug "path_to_exe_file_application"

      For release:

      windeployqt.exe --release "path_to_exe_file_application"

      windeployqt pulls only Qt libraries. They may still need some more needed for clion. You can simply run and watch what you swear at and then copy the libraries to the folder with exe, or see the dependencies utility (Dependency Walker), then show all the dependencies for the application.