QCoreapplication error on hello world



  • Hello_World_2\main.cpp:1: error: QCoreApplication: No such file or directory #include <QCoreApplication>
    
    

    I tried adding QT=+widgets which has worked in the past.

    .pro file

    TEMPLATE = app
    CONFIG += console
    CONFIG -= app_bundle
    CONFIG -= qt
    
    SOURCES += main.cpp
    QT     += widgets
    
    include(deployment.pri)
    qtcAddDeployment()
    
    
    

    main.cpp

    #include <QCoreApplication>
    #include <iostream>
    
    using namespace std;
    
    int main ()
    {
    
       return 0;
    }
    

  • Lifetime Qt Champion

    Hi,

    Remove CONFIG -= qt

    Currently you are trying to use Qt in a non Qt project


Log in to reply
 

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