[SOLVED]Qt Creator default project not building



  • I have installed Qt Creator using Qt 5, and I created a new Qt Widgets project. I then attempted to build the project, and there were no error messages. However, when I ran the project, I got an error message saying:

    Starting C:\QtProjects\build-QtWidgetsTest-Desktop_Qt_5_4_1_MSVC2010_OpenGL_32bit-Debug\debug\QtWidgetsTest.exe...
    Failed to start program. Path or permissions wrong?
    C:\QtProjects\build-QtWidgetsTest-Desktop_Qt_5_4_1_MSVC2010_OpenGL_32bit-Debug\debug\QtWidgetsTest.exe exited with code -1

    I had a look in the project's build directory and found there was no .exe file. When I built the project again, an exe file appeared, but running it caused it to disappear, saying that Windows could not find the file.

    Is there something I might not have done?



  • HI and welcome to devnet,

    are your settings correct?
    Check for:

    • Compiler
    • Qt version
    • Kits

    in Qt Creator preferences



  • Hi,
    I checked my settings in Tools->Options.
    The kit used is Desktop Qt 5.4.1 MSVC2010 OpenGL 32bit (default), which was the only one available when I created the project.
    The kit is using the Microsoft Visual C++ compiler 10.0 and the Qt version is 5.4.1.
    Is anything wrong with these settings?



  • You said that the build is executed correctly; right?

    So, go with the Explorer into the destination directory and double click on the executable.
    What happens?

    Have you some special Deployment steps? (See Projects Tab)



  • Ok, so now it's suddenly working. No idea what happened there.
    All I did was create an option on the menu bar on the default ui file and it built properly, and I could run it from within Qt creator. Weird.
    When I try to run the executable on its own, I get a different error where the Qt5 dll is not found, but that should be easy to fix.



  • @pigman980 said:

    When I try to run the executable on its own, I get a different error where the Qt5 dll is not found, but that should be easy to fix.

    This is normal if you don't add the directory where the Qt libs are into the PATH variable



  • Ok, now it's running fine both in Qt Creator and out. Thanks for your help.
    I have no idea what I did to solve the original problem, but it's solved now. I created a second project and that one worked as well.



  • ok,

    You're welcome

    Happy Programming



  • @mcosta Hi mcosta,

    I have to installed QT creator ver 4.8 and i have one project, it developed QT creator ver 4.5 in Linux platform on 2008. Now i want to update some changes for feature enhancement. i had to try to compile and run the project successfully, but i could't get the output screen. the (.pro) file generated only the .exe file only. How can i get the resultant output UI screen, what will i made for that.



  • HI,

    I suggest to open a new post because you marked this as SOLVED.
    BTW if you moved to windows and want to see the debug output you should add

    CONFIG += console
    

    to your .pro file


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.