Using Windows SDK 7.1 inside Qt Creator

I have a personal project I'm working on, which requires Microsoft SAPI5 - text to speech and speech recognition. I already developed many applications, but I decided to switch and try to learn the Qt Framework, as this will greatly simplify a lot.

The project will not be created because it cannot find the header files from the Windows SDK. I can’t understand where I was wrong.

I did my best to edit my .pro file. In addition to the one below, I also tried the version where I explicitly listed the header files, but it still could not find the file.

Error: sapi.h: no such file or directory

Includes in speech.h:

#include <QObject> #include <sapi.h> 

My .pro file is:

 QT += core gui TARGET = QT_River TEMPLATE = app INCLUDEPATH += "C:\Projects\custom libraries\include" \ "C:\Program Files\Microsoft SDKs\Windows\v7.1\Include"; win32:LIBS += "C:\Projects\custom libraries\lib_dbg" \ "C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib"; SOURCES += main.cpp \ window.cpp \ speech.cpp HEADERS += window.h \ speech.h FORMS += RESOURCES += \ systray.qrc 

PS I would like it to be cross-platform compatible, but cannot find any Qt libraries for performing speech recognition based on dictation and text-to-speech conversion. If anyone knows about one, please let me know.

PSS I searched for this answer for two hours on the Internet, including a thorough search of this website. I did not find anything that helped.

+4
source share
2 answers

Many hours later this morning, I managed to solve my problem.

Instead of using Qt Creator, I decided to use Visual Studio 2010 + Qt 4.7.1. I managed to successfully implement this solution, and my project is off the ground and is working now.

I recommend this approach for anyone trying to use the Windows SDK + Qt.

This is the resource that helped me (all the information you need is in the question):

Compiling Qt - Visual Studio 2010

+1
source

In Qt Creator, you can configure any version of Visual Studio or SDK as a toolchain, and ultimately Qt "Kit".

If you go to Tools-> Options-> Build and Run, you will be presented with the “Kits and Compilers” tabs (among others). On the Compilers tab, you must either find your compiler for the SDK version, or manually add it yourself. Then, on the “Kits” tab, select the version of Qt that matches your compiler, and select the new compiler configuration created / found. This should allow you to build from Qt Creator.

If not, let me know where this happens, so I can improve this answer with the necessary information.

+1
source

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


All Articles