Config.json error
-
I am using Qt Creator 17.0.1 on Linux Ubuntu.
Trying to compile a simple C++ GUI app with different versions of Qt, I almost always recently am getting this error message:
Error reading "~/Qt/6.5.3/gcc_64/modules/Core.json": Could not determine target architecture
I let Qt Creator's Maintenance Tool install this version of Qt as well as most of the other versions. The contents of the -
Config.json
Core.json
file look like this (and were not edited by me):{ "name": "Core", "repository": "qtbase", "version": "6.5.3", "built_with": { "compiler_id": "GNU", "compiler_target": "", "compiler_version": "10.3.1", "cross_compiled": false, "target_system": "Linux" } }
The
.pro
file I am using looks like this:QT += core gui widgets CONFIG += c++17 #message($${PWD}) LIBS += -L"/usr/lib/x86_64-linux-gnu" -licudata -licui18n -licuio -licutest -licutu -licuuc QHEXEDIT_LIBDIR = "$${PWD}/lib/Debug" message("$${QHEXEDIT_LIBDIR}") LIBS += -L"$${QHEXEDIT_LIBDIR}" -lqhexeditd # You can make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 if(greaterThan(QT_MAJOR_VERSION,5)): DEFINES += HAVE_QIODEVICEBASE ################################################## # Keep build artifacts outside of the source tree: OBJECTS_DIR = ./.obj MOC_DIR = ./.moc RCC_DIR = ./.qrc UI_DIR = ./.ui ################################################## INCLUDEPATH += \ include \ include/icu \ include/icu/msg \ ../../qhexedit2_bh_fork/src SOURCES += \ src/icu/ICUDetectMgr.cpp \ src/icu/msg/ICUErrorMessages.cpp \ src/ListEncodingsModel.cpp \ src/MainWindow.cpp \ src/main.cpp HEADERS += \ ../../qhexedit2_bh_fork/src/qhexedit.h \ include/CenteredBoxProxy.hpp \ include/icu/ICUDetectMgr.hpp \ include/icu/icu_includes.hpp \ include/icu/msg/ICUErrorMessages.hpp \ include/ListEncodingsModel.hpp \ include/MainWindow.hpp FORMS += \ forms/MainWindow.ui TRANSLATIONS += \ translations/TestIcuCodecs_de.ts
The
.pro
file was edited, and I deleted some lines at the bottom concerning deployment because I didn't think I would need them. This might be the cause of the error, but I do not know how to fix it? -
C Christian Ehrlicher moved this topic from General and Desktop
-
Which Ubuntu version are you using?
-
Which Ubuntu version are you using?
@Axel-Spoerl This is Ubuntu 24.04.3
-
Qt 6.5 officially doesn't support Ubuntu 24.04, see here.
If memory serves well, Ubuntu 24.04 ships GCC 13 out of the box. The Json expects GCC-10, Ubuntu 22 ships 11. One thing to try is installing those older GCC versions.Another thing is that Ubuntu 24 uses Wayland by default, 22 uses XCB. Just keep that in mind, in case your app depends on XCB.
Maybe it's a good idea to upgrade to Qt 6.9, where U24 is officially supported.
-
As @Axel-Spoerl has written. However, just for the record, I only ever use the Qt version which ships with an Ubuntu release. And 24.04 comes with Qt at 6.4 or 6.5 (cannot remember which), so although it is not "officially" supported I do know it works.
Also, FWIW, although 24.04 does run Wayland by default, I have ended up changing it so that it uses Xorg instead. There are too many bugs/issues, both with Qt and non-Qt applications, under Wayland for my personal taste at least (simple example: if you use MySQL Workbench, as supplied for years with Ubuntu, you cannot resize its window, the corners are unresponsive, under Wayland, which I found to be a show-stopper for my usage).
-
Qt 6.5 officially doesn't support Ubuntu 24.04, see here.
If memory serves well, Ubuntu 24.04 ships GCC 13 out of the box. The Json expects GCC-10, Ubuntu 22 ships 11. One thing to try is installing those older GCC versions.Another thing is that Ubuntu 24 uses Wayland by default, 22 uses XCB. Just keep that in mind, in case your app depends on XCB.
Maybe it's a good idea to upgrade to Qt 6.9, where U24 is officially supported.
@Axel-Spoerl and @JonB : Thank you both for your information, which is very helpful.
Looking at the repositories in Ubuntu 24,04 shown in
Synaptic
, they offer Qt modules for versions 5.15.3 and 6.4.2 of Qt. So Ubuntu 24.04.3 supports Qt versions < 6.5, but Ubuntu 24 is not supported until 6.9.1?I have all released Qt versions including the sources that Qt Creator allows me to install through their "Maintenance Tool" except for the new Qt 7 beta. I made a mistake in my first post -- the file I showed is actually
Core.json
and notConfig.json
! Looking at the differentCore.json
files for each version of Qt, they all look the same across versions until 6.9.1 which is quite different -- with the exception that in 6.5.3, the JSON is missing the following subkey under `"built_with":"architecture": "x86_64"
Also,
"compiler_version"
is"10.3.1"
for all, including 6.9.1, which seems to indicate that this would be the oldest version ofgcc
which is supported. Ubuntu 24.04 indeed ships with gcc/g++ 13.0. If this is the case, installing older versions of the compiler wouldn't help here, would it?If I insert the
"architecture"
subkey into theCore.json
file for Qt 6.5.3, the error I received should probably go away. However, I didn't test this yet. Looks like other JSON files in that folder (for 6.5.3, i.e.Gui.json
,Widgets.json
, etc.) don't have it, either. -
Strange ... even if I enable only the 5.15.13 kit, I still get the same message. This is after deleting the
.pro.user
and setting the 5.15.13 version as the only active kit.Is there some global Qt Creator configuration which is trying to read that
Core.json
file? -
These JSON files should not have to be modified. There is something wrong with the desktop configuration.