Can't find the QtCore file?

I am writing a multi-threaded program in C ++ and plan to use it QThread. The problem is when I try #include <QtCore>... I get an error message ...Cannot find include file QtCore.

What gives?

+3
source share
3 answers

You probably have include directories pointing to the root include directory of Qt, so try:

#include <QtCore/QtCore>

... or ... you do not have include directories related to Qt on the command line of your compiler.

+4
source

It looks like your .pro file is configured incorrectly.

Your source of errors is a compiler that feeds invalid include directories - this is why QtCore cannot be found.

, qmake ( Makefile), CMake .. .. , .

.pro Makefile? , ?

+2

SO , , Visual Studio #include Qt. , IDE , #include " include XXX".

The question associated with the above points to the nokia page about intellisense and QT , which indicates that Visual Studio should be run from "Qt x.xx for the desktop (MSVC 20xx)", which is part of the QT binary distribution. After starting Visual Studio from the QT command line, my problem disappeared.

+1
source

Source: https://habr.com/ru/post/1777307/


All Articles