QMainWindow file not found



  • Hi. I'm not sure if this is the correct category of this topic, but I'm in a hurry wondering how to solve this problem. Since I've searched and tried many possible solutions provided from past questions and still failed, I appreciate everyone who provides new solution or tell me where I made mistakes.
    Here's my .pro file and the debug message.
    0_1497164674790_螢幕快照 2017-06-11 下午3.04.10.png
    Thanks a lot!


  • Moderators

    Hi Yi-Fan and welcome to the Qt forum,

    Do you notice the difference between line 7 and 8 :
    QT versus Qt. It should be QT there.

    line 8 is even not needed since it's already in line 10, which tells us : if your Qt version is greater than 4 than add the module widgets.



  • @Eddy Thanks for replying!
    This solution is one of which I've viewed in other questions.
    However, even I turn 't' into 'T' now, it still shows the same messages.



  • I suspect the directory of the header file is the problem.
    I install the application on a portable external hard drive. Shall I change any setting to let IDE know where is the correct directory?


  • Moderators

    Do you have #include "mainwindow.h" in you main.cpp file.

    As I can see you are using a Qt wizard to make a QMainwindow based test application. This should work out of the box. What did you change?

    A good way to start learning is to start from the wizard, build and run, make some more changes and run again. If you made mistakes, you will know immediately what you have done.


  • Moderators

    @Yi-Fan said in QMainWindow file not found:

    I suspect the directory of the header file is the problem.
    I install the application on a portable external hard drive. Shall I change any setting to let IDE know where is the correct directory?

    Can you elaborate on you setup? otherwise we will be guessing for a long time what is going on.
    What OS are you on, what kits did you use, what version of Qt (I suspect 5.9)....



  • @Eddy I'm using mac OS X 10.11.6, and Qt 5.9.
    The kit is Desktop Qt 5.9.0 clang 64 bits


  • Moderators

    @Yi-Fan
    I would recommend to take some time to read the Qt Creator Manual - getting started It's a good read and you will feel much more confident in this new environment later on.

    If you will follow that link, you will encounter also the location of kits.


Log in to reply
 

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