1
votes

When I try to run my first program in QT I get the followinging error:

/untitled1/main.cpp:1:26: fatal error: qapplication.h: No such file or directory #include ^ compilation terminated. make: * [main.o] Error 1 09:38:51: The process "/usr/bin/make" exited with code 2. Error while building/deploying project untitled1 (kit: Desktop) When executing step 'Make' 09:38:52: Elapsed time: 00:01.

Please help me.

1
Try including QT += widgets in your .pro file.Quaxton Hale
where i found .pro in my system?VashuDeo
It should be in the same directory as your source files. Also replace qapplication.h with <QApplication>Quaxton Hale
i add these line in vashu.pro but still same errorVashuDeo
You are not running your program, you are trying to compile it!Basile Starynkevitch

1 Answers

2
votes
  1. Install Qt Creator from the Ubuntu Software Center (I know from reading your other question that you are using Ubuntu).

  2. Visit the Qt for beginners — Hello World! tutorial website.

  3. Follow the steps in the Qt for beginners — Hello World! tutorial.
    Tip: Make a new folder in your /home directory for your Qt Projects before you start the tutorial. Call the new folder QtProjects or whatever name you like.

  4. The output of the tutorial Hello World! application will appear in a separate popup window after you compile and run it.