c++qt5visual-studio-2019qmakenmake

build C++ program by qmake,nmake in windows11 ,but can not run


My C++ program source code at work is build with Qt5 on Windows 11(cross platform code, linux works well), which contains several project and all belong to One software of my company.I have question about how to build them. The older nerd tell me build them with Qt command qmake and nmake and it does work ,the *.exe and *.dll files came out.
But When I run them in Win11 console, every application works well but ONE.it say "This application cannot run on your computer". Then I rebuild this one with VS2019(vsxproj file generated by "qmake -t vcapp" with .pro file),turns out it works well.(Dose not use QtCeator). I try a lot to fix that ,but I do not have any clue, and this problem last for months. What do I need to do next?(Forgive my English is not good at all)

What do I need to do next? Or is something wrong with source code? build by qmake and nmake

build by vs2019


Solution

  • When building this with QT-Creator you need to make sure that you are using the correct toolset. For this dedicated one you worked wih the wron toolset. To fix this you need to build it with VS2019 when this is your compiler for Windows 11.

    You can do this via qmake or just in QtCreator: select the right toolset for VS2019 in your configuration.