Shellz
Shellz

Reputation: 51

Using qmake with VS Community 2015

I'm currently trying learn the in's and out's of using qmake to build a VS project file for VS Community 2015. The tutorial that I was following along with was this one: qmake tutorial

The tutorial seems simple enough and qmake ran my commands just fine. However once I launched the hello.vcxproj file and tried to compile, VS told me it was unable to find the appropriate qt header files to compile properly. These are the details regarding my .pro file and qmake commands.

// .pro file
CONFIG += qt debug
INCLUDEPATH = "C:\Qt\5.5\mingw492_32\include\QtGui"
HEADERS += hello.h
SOURCES += hello.cpp
SOURCES += main.cpp

and

// batch commands
set QMAKESPEC=win32-msvc2015
qmake -tp vc hello.pro
pause

and just in case it's needed, this is what my PATH looks like as well.

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Qt\5.5\mingw492_32\bin

Any help or push in the right direction would be greatly appreciated.

-Shellz

Upvotes: 1

Views: 4559

Answers (1)

parsley72
parsley72

Reputation: 9037

The Qt Visual Studio add-in is no longer supported in Visual Studio 2015. Microsoft decided to deprecate AddIn support in Visual Studio 2013 and with Visual Studio 2015 all support for it has been removed. This is covered in https://bugreports.qt.io/browse/QTVSADDINBUG-404. However, there's an extension called Qt5Package you can install instead. I haven't tried this in the community edition but I think it'll work.

I found when I tried to add Qt 5.6.0 Beta in the extension I got the error "This Qt version uses an unsupported makefile generator (used: MSVC.NETMSBUILD, supported: MSVC.NET, MSBUILD)". The workaround is in C:\Qt\Qt5.6.0\5.6\msvc2015\mkspecs\common\msvc-desktop.conf Qt 5.6.0 splits all the version-specific changes into a separate file msvc-base.conf. If you copy the contents of this file and replace the line "include(msvc- base.conf)" in mscv-desktop.conf then Qt5Package recognises the Qt 5.6.0 Beta with no problems.

Note this still needs to be fixed in Qt5Package.

UPDATE: Qt have released an offical plug-in for VS2013/2015/2017: http://blog.qt.io/blog/2016/11/11/qt-visual-studio-tools-2-0-released/

Upvotes: 1

Related Questions