Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 未能找到../**.h文件qt5,C++;在Windows 10上_C++_Qt_Header_Qmake - Fatal编程技术网

C++ 未能找到../**.h文件qt5,C++;在Windows 10上

C++ 未能找到../**.h文件qt5,C++;在Windows 10上,c++,qt,header,qmake,C++,Qt,Header,Qmake,我正在“VS 2017的开发者命令提示符”中运行qmake命令,但出现以下错误: c:\Projects\Yenka\yenka\Software>qmake Project MESSAGE: *** DEBUG *** Project MESSAGE: Language: Project MESSAGE: INSTALL is set to ./install WARNING: Failure to find: ../falcon_precomp.h 它不能找到.h C++头文

我正在“VS 2017的开发者命令提示符”中运行qmake命令,但出现以下错误:

c:\Projects\Yenka\yenka\Software>qmake

Project MESSAGE: *** DEBUG ***

Project MESSAGE: Language:

Project MESSAGE: INSTALL is set to ./install

WARNING: Failure to find: ../falcon_precomp.h
它不能找到.h C++头文件,但是文件在我有CD的目录下,在FalCON.PRO文件下面。为什么它找不到头文件

我是新来的建设和一个更详细的解决方案将是惊人的,如果可能的话

谢谢你的帮助

编辑:该项目最初是使用适用于Mac OS的qt5.5构建的,我正在尝试在适用于Windows的qt5.10上构建它

falcon.pro文件:

# Used by autobuild
# If you change the structure of this file please see build master
TEMPLATE = subdirs

include(config.pri)
CONFIG+= ordered

# see if we're in autobuild mode

# We use the variable KERNELDIR throughout all our project files but it can't
# be defined in config.pri because that could be included from project files
# at different places in the filesystem. See kernel.pri and domain.pri for
# their definitions of KERNELDIR ( which necessarily differ from this one ).
KERNELDIR = Kernel

autobuild {

    message("--- in autobuild mode ---")

    SUBDIRS += $$AB_DOMAINS\

    # print out all the things we're going to build
    message($$SUBDIRS)

    # build the unit tests
    # SUBDIRS += unittests

} else {

    SUBDIRS += $$KERNELDIR/core/licence/ccLG \
               $$KERNELDIR/core \
               $$KERNELDIR/ccUI \
               $$KERNELDIR/cc2D \
               $$KERNELDIR/cc3D \
               $$KERNELDIR/core/ccMigration \
               $$KERNELDIR/core/ccMigration/plugin \
               $$KERNELDIR/editor \
               $$KERNELDIR/application \
               $$KERNELDIR/bootstrap \
               $$KERNELDIR/3rdparty

    DOMAINDIR = Domains
    DOMAINS = \
               $$DOMAINDIR/equation \
               $$DOMAINDIR/presentation \
               $$DOMAINDIR/data \
               $$DOMAINDIR/probability \
               $$DOMAINDIR/maths \
               $$DOMAINDIR/flowcharts \
               $$DOMAINDIR/human3D \
               $$DOMAINDIR/electronics \
               $$DOMAINDIR/motion3D \
               $$DOMAINDIR/motion \
               $$DOMAINDIR/waves \
               $$DOMAINDIR/optics \
               $$DOMAINDIR/chemistry

   SUBDIRS += $$DOMAINS
}

# mark product package files to be searched for translatable strings

TRANSLATIONS += \
    translation.ts
Falcon_precomp.h文件:

#ifndef FALCON_PRECOMP_H
#define FALCON_PRECOMP_H

/* Falcon Pre-compiled headers

   Please only include STABLE headers here
 */

/* C includes here */

/* C++ includes here */
#if defined __cplusplus

/** Note: The following include should always be first to
    avoid un-necessary compiler warnings
 */
#include "core/core_include.h"

// us
#include "cc/Assert.h"
#include "ccModel/Document.h"
#include "ccModel/Part.h"
#include "ccModel/Model.h"
#include "ccModel/Node.h"
#include "ccModel/Pad.h"
#include "ccModel/Part.h"
#include "cc/Point.h"
#include "ccModel/Property.h"
#include "cc/Resource.h"
#include "ccModel/Validator.h"
#include "cc/Value.h"
#include "cc/Vector.h"

#include <algorithm>
#include <list>
#include <map>
#include <set>
#include <vector>

// qt
#include <QApplication>
#include <QBitmap>
#include <QEvent>
#include <QImage>
#include <QMetaObject>
#include <QObject>
#include <QString>
#include <QPainter>
#include <QPixmap>
#include <QWidget>

#endif

#endif // FALCON_PRECOMP_H
警告信息:

警告:未能找到:../falcon_precomp.h

意味着QMake在以下目录中找不到头文件:falcon_precomp.h:/


请确保falcon_precomp.h文件位于(../)上方的目录中,然后重新运行qmake命令。

您应该添加更多详细信息:1)目录源树;2) qmake.pro文件;3) falcon_precomp.h文件所在的行included@S.Monteleone我在我的原始文章中添加了Quest.Pro文件和C++头文件的内容。这两个文件都在同一个目录c::/projects/falcon1/softwarePost您的
config.pri
文件。@user3606329我已经添加了config.pri文件。更改
precompile\u头:PRECOMPILED\u头=../falcon\u precomp.h
precompile\u头:PRECOMPILED\u头=falcon\u precomp.h
,如果它在同一目录中。您好,谢谢你的评论。falcon_precomp.h位于我将cd放入的目录中,它与.pro文件位于同一目录中。这就是为什么这会让我感到困惑的原因。QMake在不同的位置查找falcon_precomp.h文件,这里是上面的:....,而不是您的.pro文件。显然这就是qmake的配置方式。您可以尝试修改qmake文件(以便它搜索它真正所在的头文件),或者将头文件移动到它查找它的位置。另一个选项是将INCLUDEPATH+=../添加到qmake配置中。
CONFIG +=  warn_on thread qt

CONFIG -= debug_and_release

# This command forces to go into release mode, for some reason release
# does not work at the moment.
# CONFIG += forcerelease

# On the current release, symbol visibility is default, as some of
# the symbols are not found otherwise during cross compilation and
# linking.
CONFIG += unhide
DEFINES += FINAL_RELEASE
DEFINES += QT_NO_DEBUG

# Set region-specific and demo build options
DEFINES += $$(CC_LANG) $$(CC_DEMO) $$(FINAL_RELEASE)

# Since NodeImpl header uses qdom.h, Qt XML module is needed by everything.
QT += xml 
# Qt Network module is needed on Mac almost everywhere.
mac: QT += network

forcerelease {
    CONFIG -= debug
    win32 {
        CONFIG += embed_manifest_exe
        CONFIG -= embed_manifest_dll
    }
    DEFINES -= DEBUG
}

# debug is default setting for everything except autobuild and forcerelease
autobuild {
    CONFIG -= debug
    win32 {
        CONFIG += embed_manifest_exe
        CONFIG -= embed_manifest_dll
    }
    DEFINES -= DEBUG
} else {
    !forcerelease {
        CONFIG += debug
        DEFINES += DEBUG
        DEFINES -= DEBUG
    }
}

debug {
    message( "*** DEBUG ***" )
    message( "Language: $$(CC_LANG)" )
}
else {
    message( "*** RELEASE $$(CC_DEMO) $$(FINAL_RELEASE) ***" )
    message( "Language: $$(CC_LANG)" )
}


DEFINES += QT_CLEAN_NAMESPACE

no_emotionfx {
    message( "config.pri: NO_EMOTIONFX is defined" )
    DEFINES += NO_EMOTIONFX
}

win32 {
    autobuild {
        # Go easy on the release build for now...
        QMAKE_CXXFLAGS_WARN_ON = /W3 /WX /wd4305
    } else { 
        # Turn on all warnings and treat treat them as errors. 
        # Well, all except C4127 as QT throws this up all the time. 
        # ... and C4512 ( assignment operators cannot be generated )
        # ... and C4100 ( unused formal parameter )
        # ... and C4709 ( comma in array index - incorrectly flags 
        #                 functions with multiple arguments in index )
        # ... and C4305 ( truncation of double to float, happens in lots of osg code )
        QMAKE_CXXFLAGS_WARN_ON = /Wall /WX /wd4127 /wd4512 /wd4100 /wd4709 /wd4305
    }

    # message( $$QMAKE_CXXFLAGS_RELEASE )
    # Release build:
      # -O2: Creates the fastest code in the majority of cases. 
      # -Oy-: Prevent frame pointer optimisation to improve stack walking
    # -Zi: Create PDB file containing debug symbols
    # -MD: (from default Qt flags)
    # -MP: parallel compilation switch
    QMAKE_CXXFLAGS_RELEASE = -O2 -Zi -MD -MP4 /Oy-

    # Remove access control from the manifest so Vista will allow 
    # us to write to the virtual store.
    QMAKE_LFLAGS_RELEASE += /DEBUG /MANIFESTUAC:NO

} else {
    # Remove those given to us by default to suppress qmake -Wall warnings
    # If this changes then then qmake -Wall will let us know provided we
    # stick to a staight assignment rather than += when we set our own.
    QMAKE_CXXFLAGS_WARN_ON -= -Wall -W
    # lots of warnings, supress unknown pragma warnings, make warnings errors
    QMAKE_CXXFLAGS_WARN_ON = -Wall -Wno-unknown-pragmas -Wunused -Werror

    # GCC 4.x
    QMAKE_CXXFLAGS_WARN_ON += -Wno-non-virtual-dtor

    # devbuilder compiler flags a few things not seen elsewhere
    mac {
        QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-result -Wno-unused-variable -Wno-c++11-extensions -Wno-format-security -Wno-overloaded-virtual -Wno-delete-non-virtual-dtor
        QMAKE_CXXFLAGS_WARN_ON += -Wno-c++11-compat-deprecated-writable-strings -Wno-unused-private-field -Wno-parentheses-equality
        QMAKE_CXXFLAGS_WARN_ON += -Wno-potentially-evaluated-expression -Wno-unused-function -Wno-empty-body -Wno-constant-logical-operand
        # GCC 4.0.1 incorrectly warns about control paths in some functions
        # not returning values when in fact the control path is actually
        # unreachable. Until we upgrade to something like 4.1 or better we
        # just disable the warning.
        QMAKE_CXXFLAGS_WARN_ON += -Wno-return-type
    }
}

mac {
    # Force precompiled headers on the mac
    #CONFIG += precompile_header

    # build fat binaries of everything. No easy way to target
    # the 10.3.9 SDK on PPC only
    autobuild {
        CONFIG += x86 ppc
    }
    QMAKE_MAC_SDK=macosx10.11
    QMAKE_CXXFLAGS_DEBUG=-gdwarf-2
}

# Precompiled headers for platforms which support this
# WARNING: Windows builds currently depend on this to work. Not sure why. The
# build goes fine without them but the app. crashes when parts are dragged on.
#!autobuild {
    precompile_header: PRECOMPILED_HEADER = ../falcon_precomp.h
#}

# The top directory in the source code hierarchy
TOPDIR = ../..

autobuild {
    DEFINES += BUILD_ID=\"\\\"$$AB_BUILD_ID\\\"\"
    DEFINES += AB_PDB_DIR=\"\\\"$$AB_PDB_DIR\\\"\"
    INSTALL += $$AB_INSTALL
    win32 {
        INCLUDEPATH += $$CPPUNIT_INCLUDE
        LIBS += $$CPPUNIT_LIB
    }
} else {
    # not in autobuild - use a default install location
    INSTALL = ./install
}

message( "INSTALL is set to $$INSTALL" )

INST_DIR = $$TOPDIR/$$INSTALL
INST_SOFTWARE_DIR = $$INST_DIR/Software

#message( "INST_SOFTWARE_DIR is set to $$INST_SOFTWARE_DIR" ) 

debug : OBJECTS_DIR = _obj
debug : MOC_DIR = _moc
!debug : OBJECTS_DIR = _obj_r
!debug : MOC_DIR = _moc_r


win32 {
    LIB = win32
    LIB_EXT = *.dll
}
unix {
    LIB = linux-i386
    LIB_EXT = *.so
}
mac {
    LIB = MacOS
    LIB_EXT = *.dylib
}

# override copy method for install stage.
# see Qt\3.3.2\qmake\generators\win32\winmakefile.cpp for more of these
# undocumented gems
win32 {
    QMAKE_INSTALL_FILE = xcopy /Y /R /K /Q
    QMAKE_INSTALL_DIR = xcopy /E /Y /R /K /Q /I
}


quantify {
    win32 {
        QMAKE_LFLAGS_RELEASE += /fixed:no /incremental:no
        QMAKE_LFLAGS_DEBUG += /fixed:no /incremental:no
        DEFINES += QUANTIFY
    }
}

unix{
    gprof {
        CONFIG += unhide
        message( "Compiling for gprof..." )
        QMAKE_CXXFLAGS += -pg
        QMAKE_LFLAGS += -pg
    }

    unhide {
        message( "Unhiding symbols..." )
        QMAKE_CXXFLAGS_DEBUG += -fvisibility=default
        QMAKE_CXXFLAGS_RELEASE += -fvisibility=default
    } else {
        # By default we mark all symbols hidden. As with Windows this is
        # overridden in code with the various EXPORT macros.
        QMAKE_CXXFLAGS_DEBUG += -fvisibility=hidden
        QMAKE_CXXFLAGS_RELEASE += -fvisibility=hidden
    }
}

win32 {
    # VS2008 reports a warning when using crt functions for which there is a new secure version
    DEFINES += _CRT_SECURE_NO_WARNINGS
}

DEFINES += QT_NO_DEBUG
DEFINES -= DEBUG

# uncomment this to get char* descriptions set on NodeImpl and
# PropertyImpl.  Easy to see in the debugger.
# DEFINES += CC_MODEL_DEBUG_STRINGS