In the qtest project the file cannot find the included files correctly.
I am working on the qtest.
So I tried to test other class and functions by including the ".pri" file. So they are shown on the file tree on the left.
But, I cannot include the file from the project of the ".pri" file. For example, the .pri project is "aaa.pri", then the aaa.h in this pri project cannot
be included as the form of #include<aaa/aaa.h>
Then I tried to include the header file in the test c++ file with a absolute/relative path, it worked: #include"../aaa/aaa.h"
anyone got any idea?
qmake include files (*.pri) do not implicitly set c++ include paths (which would make include "aaa/aaa.h" possible). You will have to set INCLUDEPATH yourself, see e.g. https://wiki.qt.io/Including_.pro_Files
actually it is also included in the .pro file.
this is also what I meant, I can see the subproject in the project tree, but in the test c++ file I cannot include the file from subproject.
that line just includes the pri-file into your pro-file. But, as I said, to make
#include"aaa/aaa.h"work you also have to tell the compiler where to search for the includes and add something like
INCLUDEPATH+=$$PWD/aaato your pro-file.
Thnx a lot. It worked