Keep getting C1083 errors in the project that has all the #includes



  • I am new QT user and following tutorials in " C++ GUI Programming with Qt 4, Second Edition" book, chapter 2 (here are files http://www.informit.com/store/c-plus-plus-gui-programming-with-qt4-9780132354165)

    While building the project(QT Creator on Win8) , I am getting errors:
    @
    c:\users\alexander\desktop\find\finddialog.h:4: error: C1083: Cannot open include file: 'QDialog': No such file or directory
    c:\Users\Alexander\Desktop\find\main.cpp:1: error: C1083: Cannot open include file: 'QApplication': No such file or directory
    c:\users\alexander\desktop\find\finddialog.h:4: error: C1083: Cannot open include file: 'QDialog': No such file or directory@

    QDialog,QApplication were included in my project.

    Thanks !



  • Verify your project file configuration. Especially QT variable - should contain core, gui and widgets if qt5.

    @
    QT += core gui

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    @



  • Thanks for reply, I have added two lines, but keep getting same errors.

    QT += core gui

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    TEMPLATE = app
    HEADERS = finddialog.h
    SOURCES = finddialog.cpp
    main.cpp

    maybe, it has to do with the fact, that project was imported and not created from scratch ??



  • bq. maybe, it has to do with the fact, that project was imported and not created from scratch ??

    if your project consists of only three files then it's better to create new gui project, copy the files into it and then add to project.

    bq. SOURCES = finddialog.cpp \ main.cpp

    @
    SOURCES = finddialog.cpp
    main.cpp
    @

    or

    @
    SOURCES = finddialog.cpp main.cpp
    @


Log in to reply
 

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