简体   繁体   English

QtCreator中的“致命错误C1083:无法打开包含文件”

[英]“Fatal Error C1083: Cannot open include file” in QtCreator

So I am working on a C++ Project in QtCreator which worked fine all the time. 因此,我正在QtCreator中进行一个C ++项目,该项目一直运行良好。 The project includes some external libraries for instance DDS solutions, but also it includes a library called "SimConnect". 该项目包括一些外部库,例如DDS解决方案,但还包括一个名为“ SimConnect”的库。 I worked with the library before and everything worked fine, but out of nowhere I am suddenly not able to compile my project anymore. 我以前在图书馆工作过,一切都很好,但是突然之间我突然无法再编译我的项目了。

I am using Qt5.6.0 with a MSVC13 32bit compiler. 我正在将Qt5.6.0与MSVC13 32位编译器一起使用。

C:\dev\simNET\application\P3DHook.h:13: Fehler: C1083: Cannot open include file: 'SimConnect.h': No such file or directory

I know this is a compiler problem, so I rechecked the .pro file to see if it adds the include and lib paths to that library correctly. 我知道这是一个编译器问题,所以我重新检查了.pro文件以查看它是否正确地将include和lib路径添加到该库中。 In my eyes this looks fine (yes the SimConnect.h file actually is in the specified path, I also tried giving it an absolute path but that did not solve the problem either): 在我看来,这看起来不错(是的,SimConnect.h文件实际上在指定的路径中,我也尝试给它提供一个绝对路径,但这也不能解决问题):

win32: LIBS += -L$$PWD/'../../_programme/P3Dv3_SDK/Utilities/SimConnect SDK/lib/' -lSimConnect

INCLUDEPATH += $$PWD/'../../_programme/P3Dv3_SDK/Utilities/SimConnect SDK/Inc'
DEPENDPATH += $$PWD/'../../_programme/P3Dv3_SDK/Utilities/SimConnect SDK/Inc'

win32:!win32-g++: PRE_TARGETDEPS += $$PWD/'../../_programme/P3Dv3_SDK/Utilities/SimConnect SDK/lib/SimConnect.lib'
else:win32-g++: PRE_TARGETDEPS += $$PWD/'../../_programme/P3Dv3_SDK/Utilities/SimConnect SDK/lib/libSimConnect.a'

I also tried to manually re-run qmake and I deleted the whole build folder , cleaned the project and tried to rebuild it. 我还尝试手动重新运行qmake,删除了整个构建文件夹 ,清理了项目并尝试重新构建它。 Same error. 同样的错误。

So next I took a look into the compile console, and spotted the part where the error occurs: 因此,接下来我看了看编译控制台,并发现了发生错误的部分:

DNDEBUG -I..\..\..\simNET\plugins\CreatorPlugin -I. -I..\..\..\simNET\application -I..\..\..\_programme\FastRTPS1.5\include -I..\..\..\..\Qt\5.6\msvc2013\include -I..\..\..\..\Qt\5.6\msvc2013\include\QtWidgets -I..\..\..\..\Qt\5.6\msvc2013\include\QtGui -I..\..\..\..\Qt\5.6\msvc2013\include\QtANGLE -I..\..\..\..\Qt\5.6\msvc2013\include\QtCore -Irelease -I..\..\..\..\Qt\5.6\msvc2013\mkspecs\win32-msvc2013 -Forelease\ @C:\Users\crolk\AppData\Local\Temp\CreatorPluginPublisher.obj.2256.47.jom
CreatorPluginPublisher.cpp
    C:\Qt\5.6\msvc2013\bin\moc.exe -DUNICODE -DWIN32 -DQT_NO_DEBUG -DQT_PLUGIN -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG -D_MSC_VER=1800 -D_WIN32 -IC:/Qt/5.6/msvc2013/mkspecs/win32-msvc2013 -IC:/dev/simNET/plugins/CreatorPlugin -IC:/dev/simNET/application -IC:/dev/_programme/FastRTPS1.5/include -IC:/Qt/5.6/msvc2013/include -IC:/Qt/5.6/msvc2013/include/QtWidgets -IC:/Qt/5.6/msvc2013/include/QtGui -IC:/Qt/5.6/msvc2013/include/QtANGLE -IC:/Qt/5.6/msvc2013/include/QtCore -I. ..\..\..\simNET\plugins\CreatorPlugin\CreatorPluginPublisher.h -o release\moc_CreatorPluginPublisher.cpp
..\..\..\simNET\application\P3DHook.h(13) : fatal error C1083: Cannot open include file: 'SimConnect.h': No such file or directory

It looks like it adds other include paths (such as the one for my DDS library) but it simply won't add the SimConnect one, no matter how often I rerun qmake. 看起来它添加了其他包含路径(例如,用于我的DDS库的一个),但是无论我多久重新运行一次qmake,它都不会添加SimConnect。

Has anyone an idea what the problem could be? 有谁知道可能是什么问题?

EDIT: I noticed that the build actually does not even fail. 编辑:我注意到该构建实际上甚至没有失败。 It successfully builds my project and creates the executable. 它成功构建了我的项目并创建了可执行文件。 For some reason QtCreator will still think the build failed and will show me that error. 由于某种原因,QtCreator仍会认为构建失败,并会向我显示该错误。 Running my executable manually without QtCreator works fine... 在没有QtCreator的情况下手动运行我的可执行文件可以正常工作...

Maybe your include paths have some unrecognizable symbols. 也许您的包含路径中有一些无法识别的符号。 What is your absolute paths? 你的绝对路径是什么?

Solution was the following: 解决方案如下:

My application consists of 3 subprojects: the main gui application + 2 plugins, which include some main gui's source code. 我的应用程序包含3个子项目:主gui应用程序+ 2个插件,其中包括一些主gui的源代码。 Now the error occured in the source code of the main application, but exactly that source code happened to be included by one of the plugins. 现在,该错误发生在主应用程序的源代码中,但是恰好该源代码恰好包含在其中一个插件中。 In that plugins .pro file, there was no path given to the external SimConnect library though, which was the problem. 在该插件.pro文件中,虽然没有给外​​部SimConnect库的路径,但这是问题所在。

So... If you include source code from another of your projects, make sure to also include all the dependencies needed in that subproject. 所以...如果您包括另一个项目的源代码,请确保还包括该子项目中所需的所有依赖项。 Because otherwise it might lead to a misunderstandable error message. 因为否则可能会导致产生错误的错误消息。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SWIG致命错误C1083:无法打开包含文件 - SWIG Fatal error C1083: Cannot open include file 致命错误C1083:无法打开包含文件:'iostream':没有这样的文件或目录 - fatal error C1083: Cannot open include file: 'iostream': No such file or directory 严重错误C1083:无法打开包含文件:'vld.h':没有此类文件或目录 - fatal error C1083: Cannot open include file: 'vld.h': No such file or directory 致命错误 C1083:无法打开包含文件:“xyz.h”:没有这样的文件或目录? - fatal error C1083: Cannot open include file: 'xyz.h': No such file or directory? 致命错误C1083:无法打开包含文件:'boost / variant.hpp':没有这样的文件或目录 - fatal error C1083: Cannot open include file: 'boost/variant.hpp': No such file or directory 致命错误 C1083:无法打开包含文件:“boost/config.hpp”:没有这样的文件或目录 - fatal error C1083: Cannot open include file: 'boost/config.hpp': No such file or directory 严重错误C1083:无法打开包含文件:'xmemory':没有此类文件或目录 - fatal error C1083: Cannot open include file: 'xmemory': No such file or directory 严重错误C1083:无法打开包含文件:'mexutils.h':没有此类文件或目录 - fatal error C1083 : Cannot open include file: 'mexutils.h': No such file or directory 致命错误 C1083:无法打开包含文件:'opencv2/core.hpp':没有那个文件或目录 - Fatal error C1083: Cannot open include file: 'opencv2/core.hpp': No such file or directory Qt-C ++-致命错误C1083:无法打开包含文件:'afx.h' - Qt - C++ - fatal error C1083: Cannot open include file: 'afx.h'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM