I'm trying to link Qt5 in Visual Studio 15 2017.
I have added the paths and file references for additional (1) include directories, (2) library directories and (3) dependencies in the Property Pages.
I can include header files by refering to their path like this
#include <QtWidgets/qpushbutton.h>
However, the github project I'm trying to build uses this line
#include <QtWidgets>
Visual Studio shows me an error on those lines
E1696 cannot open source file "QtWidgets"
When creating a solution from a .pro
file using the Qt VS Tools in Visual Studio, I can include <QtWidgets>
. But how can I include it in my existing project, which has not been created from a .pro
file.
Solution
Placing a MyProjectName.pro file (with QT += core gui widgets
) in the MyProjectName Folder and opening it with Qt VS Tools > Open Qt Project File (.pro) solves this problem. I can now include <QtWidgets>
. But this doesn't seem like the correct way, given the VS gui.