简体   繁体   中英

Qt Creator won't build

I have been tasked with converting a project that was built in QtCreator to .NET

The first thing I am trying to do is build the project in QtCreator so that I can step thru its execution to follow the flow and see some of the variables at play (real values).

When I build, I get a lot of errors like this:

error: C1083: Cannot open include file: 'QFrame': No such file or directory
error: C1083: Cannot open include file: 'QMainWindow': No such file or directory
error: C1083: Cannot open include file: 'QSpinBox': No such file or directory

When I search my drive, I do find 'QFrame', but in paths that have things like this in them:

android_armv7
msvc2013_64
winphone_x86
winrt_x64

Here is my .pro file

TEMPLATE = app

CONFIG *= warn_on
CONFIG(debug, debug|release): CONFIG *= console

QT += widgets

#------------------------------------------------------------
# Source Files
#------------------------------------------------------------

FORMS += \
    GUIDemo.ui \
    Registration.ui \

HEADERS += \
    CustomFrames.h \
    GUIDemo.h \
    MultiRadar.h \
    QControlUtils.h \
    ScannerInfo.h \
    TabAdvanced.h \
    TabBScan.h \
    TabGuardZone.h \
    TabImage.h \
    TabInstallation.h \
    TabPPI.h \
    TabTargets.h \

SOURCES += \
    CustomFrames.cpp \
    GUIDemo.cpp \
    MultiRadar.cpp \
    QControlUtils.cpp \
    ScannerInfo.cpp \
    TabAdvanced.cpp \
    TabBScan.cpp \
    TabGuardZone.cpp \
    TabImage.cpp \
    TabInstallation.cpp \
    TabPPI.cpp \
    TabTargets.cpp \
    main.cpp \

#------------------------------------------------------------
# Include directories
#------------------------------------------------------------

INCLUDES = \
    ../../include \


#------------------------------------------------------------
# UI Generation
#------------------------------------------------------------

CONFIG(debug,   debug|release): TARGET_DIR = debug
CONFIG(release, debug|release): TARGET_DIR = release

UI_DIR = GeneratedFiles
MOC_DIR = $${UI_DIR}/$${TARGET_DIR}
INCLUDEPATH += $${UI_DIR}

#------------------------------------------------------------
# Libraries
#------------------------------------------------------------

LIBS += \
    -L../../lib/$${TARGET_DIR} \
    -lNRPClient \
    -lNRPPPI \

#------------------------------------------------------------
# Final config
#------------------------------------------------------------

#set the qmake variables
DEPENDPATH += $$INCLUDES
INCLUDEPATH += $$INCLUDES

The folder indicated by INCLUDES is there and contains a bunch of project-specific header files.

I have a feeling that I am missing some part of QtCreator that would allow me to build for Win7.

Qt Creator is just the IDE. You need to have installed the Qt libraries as well, so make sure you have them.

These errors suggest that the project's .pro file should add the widgets module:

QT += widgets

This makes sure the project includes the right include directories (the ones that have QFrame and such) and library directories on Qt 5.x.

EDIT:

After a little bit of chat, we discovered that Qt SDK for MS2010 was installed, but since the OP had MS2013 on his box, what solved the problem was downloading and installing Qt SDK for MS2013.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM