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

Failure to find ../****.h file qt5, C++ on Windows 10

本文关键字:文件 C++ qt5 Windows 找不到      更新时间:2023-10-16

我在"VS 2017的开发人员命令提示符"中运行qmake命令,但出现此错误:

c:ProjectsYenkayenkaSoftware>qmake
Project MESSAGE: *** DEBUG ***
Project MESSAGE: Language:
Project MESSAGE: INSTALL is set to ./install
WARNING: Failure to find: ../falcon_precomp.h

它找不到 .h C++头文件,但该文件位于我在 falcon.pro 文件下的目录中。为什么找不到头文件?

我是建筑新手,如果可能的话,更详细的解决方案会很棒。

感谢您的帮助!

编辑:该项目最初是使用适用于Mac OS的qt 5.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

配置.pri 文件:

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 Qt3.3.2qmakegeneratorswin32winmakefile.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

警告消息:

警告:找不到:../falcon_precomp.h

表示 QMake 在上面的目录中找不到头文件:falcon_precomp.h:.。/

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