Visual Studio Cannot open include file 'QtConcurrent'L No such file or directory
-
Hello,
I am having an issue building a project I have taken over from another developer.
I am using Visual Studio 2019 with Qt 6.2.0 and receive the error Cannot open include file: 'QtConcurrent': No such file or directory when I try build the project. The #include <QtConcurrent> in my source file is highlighted.
So far I have added concurrent to the Qt Modules under Qt Project Settings.
Also under C/C++ -> Command line in the All Options "C:\Qt\6.2.0\msvc2019_64\include\QtConcurrent" exists.I was wondering if anyone could help me discover what I am missing please?
Thanks,
-
@ConorCodes May be you can try this-> Right click on project on visual studio -> click properties (on the bottom) -> go to C/C++ -> all options -> find additional include directories and there add path to your QT include folder
-
@ConorCodes said in Visual Studio Cannot open include file 'QtConcurrent'L No such file or directory:
I was wondering if anyone could help me discover what I am missing please?
Do you have add
QtConcurrent
package in your project?
For qmake project addQT += concurrent
in PRO file
For cmake, add following inCMakeLists.txt
:find_package(Qt6 COMPONENTS Concurrent REQUIRED) target_link_libraries(mytarget PRIVATE Qt6::Concurrent)
-
@KroMignon said in Visual Studio Cannot open include file 'QtConcurrent'L No such file or directory:
QT += concurrent
Hello KroMignon,
Thank you for your response.
I am using qmake to build my Visual Studio project, do you know where I can find the correct .pro file?
I tried to add QT += concurrent to QtTestTool\Debug\qmake\temp qtvars.pro is this the correct location as I'm trying to run my program in debug?
Thanks
-
@ConorCodes said in Visual Studio Cannot open include file 'QtConcurrent'L No such file or directory:
I tried to add QT += concurrent to QtTestTool\Debug\qmake\temp qtvars.pro is this the correct location as I'm trying to run my program in debug?
The PRO file is your project file!!!!
-
The solution which solved my issue was editing the VC++ Project file and ensuring that concurrent was in <QtModules> inside each <PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="QtSettings">
<QtInstall>Qt 6.2.0</QtInstall>
<QtModules>concurrent;core;gui;widgets</QtModules>
<QtBuildConfig>debug</QtBuildConfig>
</PropertyGroup>