Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
6.2.2
-
None
Description
Hi,
Using QT_NAMESPACE is broken.
I've built Qt using vcpkg with the following triplet:
Unable to find source-code formatter for language: cmake. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
# https://vcpkg.io/en/docs/users/triplets.html set(VCPKG_TARGET_ARCHITECTURE arm64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_CMAKE_SYSTEM_NAME Darwin) set(VCPKG_OSX_ARCHITECTURES arm64) set(VCPKG_C_FLAGS "-fvisibility=hidden -DQT_NAMESPACE=ClapPluginsQt") set(VCPKG_CXX_FLAGS "-fvisibility=hidden -fvisibility-inlines-hidden -DQT_NAMESPACE=ClapPluginsQt") # if(NOT PORT MATCHES "harfbuzz") # # harfbuzz is badly packaged for now, so we also make the debug build # # https://github.com/microsoft/vcpkg/issues/22680 # set(VCPKG_BUILD_TYPE release) # endif()
Which resulted in the following error:
/Users/abique/develop/clap-examples/vcpkg/buildtrees/qtbase/src/0314153366-c5a98c1faf.clean/src/tools/moc/collectjson.cpp:37:28: error: unknown type name 'QIODevice' static bool readFromDevice(QIODevice *device, QJsonArray *allMetaObjects) ^ /Users/abique/develop/clap-examples/vcpkg/buildtrees/qtbase/src/0314153366-c5a98c1faf.clean/src/tools/moc/collectjson.cpp:37:47: error: unknown type name 'QJsonArray' static bool readFromDevice(QIODevice *device, QJsonArray *allMetaObjects) ^ /Users/abique/develop/clap-examples/vcpkg/buildtrees/qtbase/src/0314153366-c5a98c1faf.clean/src/tools/moc/collectjson.cpp:39:11: error: unknown type name 'QByteArray'; did you mean 'ClapPluginsQt::QByteArray'? const QByteArray contents = device->readAll(); ^~~~~~~~~~ ClapPluginsQt::QByteArray /Users/abique/develop/clap-examples/vcpkg/buildtrees/qtbase/arm64-osx-clap-plugins-dbg/include/QtCore/../../../src/0314153366-c5a98c1faf.clean/src/corelib/kernel/qmetatype.h:1409:1: note: 'ClapPluginsQt::QByteArray' declared here QT_FOR_EACH_STATIC_CORE_CLASS(QT_FORWARD_DECLARE_STATIC_TYPES_ITER) ^ /Users/abique/develop/clap-examples/vcpkg/buildtrees/qtbase/arm64-osx-clap-plugins-dbg/include/QtCore/../../../src/0314153366-c5a98c1faf.clean/src/corelib/kernel/qmetatype.h:130:23: note: expanded from macro 'QT_FOR_EACH_STATIC_CORE_CLASS' F(QByteArray, 12, QByteArray) \ ^ /Users/abique/develop/clap-examples/vcpkg/buildtrees/qtbase/src/0314153366-c5a98c1faf.clean/src/tools/moc/collectjson.cpp:43:5: error: unknown type name 'QJsonParseError'; did you mean 'ClapPluginsQt::QJsonParseError'?
Do you have QT_NAMESPACE tests in your CI?
Regards,
Alex