Important: Please read the Qt Code of Conduct -

App is not a valid Win32 application

  • Hi I'm porting an legacy app from Qt4.8.5 to Qt5.4.2 and compiler Mingw 3.4.5 to 4.8.4 (4.9.1) on WinXP. It's using dozen libraries (dll) from another project which I've also migrated. Everything compiles fine, however when trying to run I'm getting: "Cannot execute "": %1 is not a valid Win32 application." and in console (cmd): "Access denied".
    I was checking that app in tool called Execinfo and it says, that my executable is" SHARED LIBRARY". The TEMPLATE=app. Tool named Dependency Walker shows all (qt5 and custom) DLLs are available, and x86.
    I tried making hello world main, without includes just the same pro file and result is the same.
    Independent hello world app as well as that very few test that exists are running (are executable) fine. Any suggestion how to proceed? How to check on WinXP what's going on? I'm Windows newbie. Thanks.

  • Did you follow also the windows deployment guide?
    The dependency walker cannot show those required plugins.

    Can you actually compile and link one of the "hello world" stuff yourself?
    Or are you simply starting already compiled versions?

  • Ok, I've found it. In one of the includes inside the qmake pro file was:
    CONFIG += dll
    This was causing the exe file (TEMPLATE=app) to behave like library dll and those weird errors. Dependency walker was then able to show me all the dependencies fulfilled BUT the option Profile->Start Profiling was disabled. This is enables jut for executable exe files :-) I tried renaming dll file to exe and the errors were the same.

  • Good to know that you have found your problem and solved it.

    Please mark thread as solved. This makes it easier for others.