-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix compilation errors when building with Qt 6.2.3 #1
Open
caarmen
wants to merge
2
commits into
qt:6.2.3
Choose a base branch
from
caarmen:6.2.3-fix-compilation-errors
base: 6.2.3
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When building qtspeech against Qt 6.2.3, we see the below compilation error. ``` qtexttospeech_osx.mm:192:12: error: no viable conversion from returned value of type 'QString' to function return type 'QLocale' return QString::fromNSString(attrs[NSVoiceLocaleIdentifier]); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/jdoe/dev/Qt/6.2.3/macos/lib/QtCore.framework/Headers/qlocale.h:930:5: note: candidate constructor not viable: no known conversion from 'QString' to 'QLocale::Language' for 1st argument QLocale(Language language, Script script = AnyScript, Territory territory = AnyTerritory); ^ /Users/jdoe/dev/Qt/6.2.3/macos/lib/QtCore.framework/Headers/qlocale.h:931:5: note: candidate constructor not viable: no known conversion from 'QString' to 'const QLocale &' for 1st argument QLocale(const QLocale &other); ^ /Users/jdoe/dev/Qt/6.2.3/macos/lib/QtCore.framework/Headers/qlocale.h:1129:5: note: candidate constructor not viable: no known conversion from 'QString' to 'QLocalePrivate &' for 1st argument QLocale(QLocalePrivate &dd); ^ /Users/jdoe/dev/Qt/6.2.3/macos/lib/QtCore.framework/Headers/qlocale.h:928:14: note: explicit constructor is not a candidate explicit QLocale(const QString &name); ^ 1 error generated. ``` To prevent this error, use the `QLocale(QString)` constructor.
When building qtspeech against Qt 6.2.3, mingw_64, we see the below compilation error. ``` In file included from C:/Qt/Tools/mingw900_64/x86_64-w64-mingw32/include/windows.h:72, from C:/Qt/6.2.3/mingw_64/include/QtCore/qt_windows.h:64, from qtexttospeech_sapi.h:40, from qtexttospeech_sapi.cpp:37: C:/Qt/Tools/mingw900_64/x86_64-w64-mingw32/include/winuser.h:2965:43: error: variable 'CreateSyntheticPointerDevice' definition is marked dllimport 2965 | WINUSERAPI HSYNTHETICPOINTERDEVICE WINAPI CreateSyntheticPointerDevice(POINTER_INPUT_TYPE pointerType, ULONG maxCount, POINTER_FEEDBACK_MODE mode); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:/Qt/Tools/mingw900_64/x86_64-w64-mingw32/include/winuser.h:2965:72: error: 'POINTER_INPUT_TYPE' was not declared in this scope; did you mean 'PRINTER_FONTTYPE'? 2965 | WINUSERAPI HSYNTHETICPOINTERDEVICE WINAPI CreateSyntheticPointerDevice(POINTER_INPUT_TYP pointerType, ULONG maxCount, POINTER_FEEDBACK_MODE mode); | ^~~~~~~~~~~~~~~~~ | PRINTER_FONTTYPE C:/Qt/Tools/mingw900_64/x86_64-w64-mingw32/include/winuser.h:2965:110: error: expected primary-expression before 'maxCount' 2965 | WINUSERAPI HSYNTHETICPOINTERDEVICE WINAPI CreateSyntheticPointerDevice(POINTER_INPUT_TYPE pointerType, ULONG maxCount, POINTER_FEEDBACK_MODE mode); | ^~~~~~~~ C:/Qt/Tools/mingw900_64/x86_64-w64-mingw32/include/winuser.h:2965:120: error: 'POINTER_FEEDBACK_MODE' was not declared in this scope 2965 | WINUSERAPI HSYNTHETICPOINTERDEVICE WINAPI CreateSyntheticPointerDevice(POINTER_INPUT_TYPE pointerType, ULONG maxCount, POINTER_FEEDBACK_MODE mode); | ^~~~~~~~~~~~~~~~~~~~~ C:/Qt/Tools/mingw900_64/x86_64-w64-mingw32/include/winuser.h:2965:146: error: expression list treated as compound expression in initializer [-fpermissive] 2965 | WINUSERAPI HSYNTHETICPOINTERDEVICE WINAPI CreateSyntheticPointerDevice(POINTER_INPUT_TYPE pointerType, ULONG maxCount, POINTER_FEEDBACK_MODE mode); | ^ C:/Qt/Tools/mingw900_64/x86_64-w64-mingw32/include/winuser.h:2966:93: error: 'POINTER_TYPE_INFO' does not name a type; did you mean 'POINTER_64_INT'? 2966 | WINUSERAPI WINBOOL WINAPI InjectSyntheticPointerInput(HSYNTHETICPOINTERDEVICE device, CONST POINTER_TYPE_INFO* pointerInfo, UINT32 count); | ^~~~~~~~~~~~~~~~~ | POINTER_64_INT ``` Based on a tip mentioned in a related issue [QTEXT-14](https://bugreports.qt.io/projects/QTEXT/issues/QTEXT-14), workaround this by including `windows.h`, before including `qt_windows.h`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Greetings!
I'm currently building qtspeech, on a system which has Qt 6.2.3, which I believe is the latest stable version as of when I'm opening this PR.
There are a couple of compilation errors.
Here are some suggested fixes.
I'm creating this PR based on the
6.2.3
branch, as that's the version of Qt that I'm using to build. I had more errors building thedev
branch, which I won't get into here (some errors about plugin classes). I don't know which version of Qt is required to build thedev
branch.One error appears on all the platforms I tested (mac, linux, windows), and one is just on windows.
1️⃣ First error:
Fix compilation error casting
QString
toQLocale
.When building qtspeech against Qt 6.2.3, we see the below compilation error.
To prevent this error, use the
QLocale(QString)
constructor.2️⃣ Second error:
When building qtspeech against Qt 6.2.3, mingw_64, we see the below compilation error.
Based on a tip mentioned in a related issue QTEXT-14, workaround this by including
windows.h
, before includingqt_windows.h
.☝️ Note that
src/plugins/tts/winrt/qtexttospeech_winrt.h
also includesqt_windows.h
. I didn't see any compilation errors for that, but I think thewinrt
project wasn't compiled at all on my machine.