Important: Please read the Qt Code of Conduct -

Problems with exe files generated by QT

  • I have a QT486 application and lunched from QT creator 3.1.2 it works great in both Debug and Release modes.
    The problems are with the exe files generated by QT in both Debug and Release folders. If I try to lunch the exe file from my application's debug folder it starts but when i press a button is shows this error:

    when i lunch the exe file generated in Release folder and press the same button it crashes like this

    More specific, when i press that button it shows the file open dialog window and after i select an image it crashes. In normal operation, when I press that button the app should load an image, display it and shows some data about that image.

    I have placed in both Release and Debug folders all DLL needed. I tried to debug it with CDB auto-detected debugger but going step by step with the debugger, I found no problem ! It works lunched from QT creator.

    Have no idea what to do, maybe I can get some useful suggestions.

  • Hi, I've seen that error (str != NULL) before, I got it when I tried to write a file that wasn't opened properly because of wrong directory. (I solved it by prefixing with the full path.)
    Maybe you have the same problem, because if you launch your app from Qt Creator, or launch it from the Debug/Release folders, the current directory will not be the same.

  • Thank you for the reply.

    I have something like this in my code:

    fileName = QFileDialog::getOpenFileName(this,tr("Open Enroll Image"),QDir::currentPath(),tr("Image Files [ *.jpg , *.jpeg , *.bmp , *.png , *.gif]"));
    QImage imageE(fileName);


    I think in fileName will be the full path, right?

    I tried also to run the exe files as administrator (maybe a permission issue) but the error persists.

    [edit: added missing coding tags @ SGaist]

Log in to reply