‘mimetype_database’ was not declared in this scope while cross compiling qt5.15.17
-
Hi I am cross compiling qt5.15.17 using a the yocto SDK for a development board. After configuration when I ran
make installi get the following error:In file included from global/qt_pch.h:56: mimetypes/qmimeprovider.cpp: In constructor ‘QMimeXMLProvider::QMimeXMLProvider(QMimeDatabasePrivate*, QMimeXMLProvider::InternalDatabaseEnum)’: mimetypes/qmimeprovider.cpp:637:30: error: ‘mimetype_database’ was not declared in this scope Q_STATIC_ASSERT_X(sizeof(mimetype_database), "Bundled MIME database is empty"); ^~~~~~~~~~~~~~~~~ global/qglobal.h:126:68: note: in definition of macro ‘Q_STATIC_ASSERT_X’ # define Q_STATIC_ASSERT_X(Condition, Message) static_assert(bool(Condition), Message) ^~~~~~~~~ mimetypes/qmimeprovider.cpp:637:30: note: suggested alternative: ‘mimeTypeForName’ Q_STATIC_ASSERT_X(sizeof(mimetype_database), "Bundled MIME database is empty"); ^~~~~~~~~~~~~~~~~ global/qglobal.h:126:68: note: in definition of macro ‘Q_STATIC_ASSERT_X’ # define Q_STATIC_ASSERT_X(Condition, Message) static_assert(bool(Condition), Message) ^~~~~~~~~ mimetypes/qmimeprovider.cpp:638:52: error: ‘MimeTypeDatabaseOriginalSize’ was not declared in this scope Q_STATIC_ASSERT_X(sizeof(mimetype_database) <= MimeTypeDatabaseOriginalSize, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ global/qglobal.h:126:68: note: in definition of macro ‘Q_STATIC_ASSERT_X’ # define Q_STATIC_ASSERT_X(Condition, Message) static_assert(bool(Condition), Message) ^~~~~~~~~ mimetypes/qmimeprovider.cpp:638:52: note: suggested alternative: ‘QMimeDatabasePrivate’ Q_STATIC_ASSERT_X(sizeof(mimetype_database) <= MimeTypeDatabaseOriginalSize, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ global/qglobal.h:126:68: note: in definition of macro ‘Q_STATIC_ASSERT_X’ # define Q_STATIC_ASSERT_X(Condition, Message) static_assert(bool(Condition), Message) ^~~~~~~~~Qt configuration command:
./configure -opensource -confirm-license -prefix /usr/local/qt5 -device linux-custom-device-g++ -device-option CROSS_COMPILE=$COMPILER_PATH -sysroot $TSYSROOT -nomake tests -no-kms -no-gbm -no-sse2 -no-sse3 -no-xcb -release -skip qtlocation -skip webengine -eglfs -opengl es2 -qpa wayland -sharedHost machine : Ubuntu 22.04
What should I do to fix this issue ?
I did tried to compile qt5.14.2 with the same configuration and it works fine. I am also getting the same error when I try to compile 5.15.0 as well.
-
Qt 5.15 isn't supported anymore, just to begin with ;-)
MimeTypeDatabaseOriginalSizeis a static constexpr, the absence of which suggests that somehowconfigurehas flippedFEATURE_mimetypetoOFF. Probably a dependency has been added after 5.14. Please check the configure output for more information.
Please also try Qt 6 (at least 6.5, better 6.9) and see if it still happens.