I am cloning a open-sourced project and I found a strange problem. The project is using:
QLocalSocket* _so;
QLocalServer* _se;
in A.h file
#include <QtNetwork/QLocalServer>
#include <QtNetwork/QLocalSocket>
If I just include these two files in A.h file, everything is fine, However I noticed and globally searched, <Q****> are only been included in A.cpp file.
So, here is the question: why the original project works fine but I cannot go through the compiling?
Of Course, that is not a small project, so actually A.h in also been included in B,C,D. I also tried
#include <QtNetwork/QLocalServer>
#include <QtNetwork/QLocalSocket>
in B.cpp , C.cpp , still not working.
Just very curious!
Repeat: the problem is how to go through the compilation with <Q***> only include in .cpp file while using in .h file.
Severity Code Description Project File Line Suppression State Error C2065 '_so': undeclared identifier