Reputation: 157
So I am working on a C++ Project in QtCreator which worked fine all the time. The project includes some external libraries for instance DDS solutions, but also it includes a library called "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.
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. 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):
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. 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.
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. Running my executable manually without QtCreator works fine...
Upvotes: 2
Views: 2487
Reputation: 157
Solution was the following:
My application consists of 3 subprojects: the main gui application + 2 plugins, which include some main gui's source code. 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.
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.
Upvotes: 1
Reputation: 870
Maybe your include paths have some unrecognizable symbols. What is your absolute paths?
Upvotes: 0