Error QApplication: no such file or directory

前端 未结 11 1924
挽巷
挽巷 2021-01-30 06:44

I have installed C++SDK that have Qt but when I try compiling a code linking QApplication it gives me the error:

Error QApplication: no such file or directory
         


        
11条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-30 07:15

    Looks like you don't have the development libraries installed. Install them using:

    sudo apt-get install libqt4-dev
    

    As you said int the comments that you have them installed, just re-install it. Now. to update the locate's database, issue this command $sudo updatedb

    Then $locate QApplication to check that you now have the header file installed.

    Now, goto the the folder where you have the code & type these commands

    qmake -project
    qmake
    make
    

    Then you can find the binary created.

    Alternatively, you can use Qt Creator if you want the GUI.

    • See the official documentation for more info. http://developer.qt.nokia.com/doc/qt-4.8/gettingstartedqt.html

    • To learn how to use Qt Creator, use http://doc.qt.nokia.com/qtcreator-2.2/creator-qml-application.html

提交回复
热议问题