Build error with QTextToSpeech in QT6.4.0
-
Hi all, I'm using Qt 6.4 on macOS. I am trying to convert my TextToSpeech application for Qt 5.15 to Qt 6.4, but I'm stuck.
My procedure is as follows:- Open Qt Creator
- [Create Project...]->"Qt widget application" (all defaults thereafter except "qmake" as build system)
- add "QT += texttospeech" into .pro file.
- add "#include <QTextToSpeech>" into mainwindow.cpp.
- Build it, then I got "In included file: 'QtQmlIntegration/qqmlintegration.h' file not found" error.
How to solve it? Any additional configuration in .pro file in Qt 6.4?
-
Hi and welcome to devnet,
What if you use the include of the class you actually use rather than the module wide include ?
-
Hi and welcome to devnet,
What if you use the include of the class you actually use rather than the module wide include ?
@SGaist
Thank you for your reply on my question!
You mean that I don't need the line "QT+=texttospeech" module definition?
It seems to be needed to turn on the tts functionality.Anyway, I found a workaround.
Add the line below to .pro file.
INCLUDEPATH += /Qt_installed_path/6.4.0/macos/include/In Step 4 of my above explanation, "#include <QTextToSpeech>" reads the file "/Qt_installed_path/6.4.0/macos/lib/QtTextToSpeech.framework/Versions/A/Header/QTextToSpeech" and the contents of this file is only one line:
$ cat QTextToSpeech
#include "qtexttospeech.h"At the line 17 of qtexttospeech.h, there is "#include <QtQmlIntegration/qqmlintegration.h>".
The file, qqmlintegration.h is there at "/Qt_installed_path/6.4.0/macos/include/".
Clang does not seem to search header files in"/Qt_installed_path/6.4.0/macos/include/“ directory.
So, we need add this directory to INCLUDEPATH.However, it looks ad-hoc workaround.
Can anyone know the essential solution? -
My bad !
I forgot that there was a class named like that and mixed it which the module wide include.As a workaround, I think (I don't have my machine at hand right now) you can add
QT += qml
to your .pro file. -
My bad !
I forgot that there was a class named like that and mixed it which the module wide include.As a workaround, I think (I don't have my machine at hand right now) you can add
QT += qml
to your .pro file.