开发者

Using Windows SDK 7.1 inside Qt Creator

I have a personal project I'm working on that requires Microsoft SAPI5 -- text to speech and Speech Recognition. I have already built out a lot of the application, but I've decided to switch and try to learn the Qt Framework, as it will make a lot of things much simpler.

The project won't build as it can't find the header files from the Windows SDK. I can't figure out where I went wrong.

I've done my best to edit my .pro file. In addition to what's below, I also tried a version where I explicitly listed the header files, but it still couldn't find the file.

Error: sapi.h: No such file or directory

Includes in speech.开发者_C百科h:

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

My .pro file:

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

P.S. I'd like to keep it cross platform compatible, but can find no Qt libraries for doing dictation based Speech Recognition and text-to-speech. If anyone knows of one, please let me know.

P.S.S. I've been searching for this answer for about two hours on the internet, including a thorough search of this website. I found nothing that helped.


After many hours this morning, I've managed to resolve my problem.

Rather than using Qt Creator, I've decided to use Visual Studio 2010 + Qt 4.7.1. I've managed to implement this solution successfully, and have my project off the ground and running 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


In Qt Creator you should be able to set up any version of Visual Studio or the SDK as a toolchain and eventually a Qt "Kit".

If you go to Tools->Options->Build & Run, you are presented with the Kits and Compilers tabs (among others). On the Compilers tab, you should either find your SDK version compiler, or you can manually add it yourself. Next, on the Kits tab, pick the version of Qt that matches your compiler, and select your newly created/found compiler configuration. This should make it possible for you to build from within Qt Creator.

If not, please tell me where it goes wrong, so I can improve this answer with the information you need.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜