Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QCoreapplication error on hello world
QtWS25 Last Chance

QCoreapplication error on hello world

Scheduled Pinned Locked Moved General and Desktop
qcoreapplicatio
2 Posts 2 Posters 4.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • TechnologistT Offline
    TechnologistT Offline
    Technologist
    wrote on last edited by
    #1
    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;
    }
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Remove CONFIG -= qt

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

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved