I am using the compiler from the docker images from George. I am using newlib. Never tried clib4 (but could). Just if nothing is mentioned I always assume it will be newlib

The code is from RetroArch, which I up to now compiled using the default GUI but it has a Qt6 GUI and I would like to try that one.
I got some missing symbols away but some are still in (some probably due to me using newlib and the Qt stuff using clib4). But let's talk for now just on the other stuff.
I got a lot of missing symbols of the RetroArch Qt6 Code. Here is what ChatGPT is telling me about it (he could as well be talking chinese - can you tell me what a MOC is ?)
--- snip ---
That _ZTV15ThumbnailWidget (vtable) undefined is classic missing MOC for a class with Q_OBJECT.
You’ve got lots of classes with Q_OBJECT (ThumbnailWidget, TreeView, MainWindow, …) declared inside ui_qt.cpp, not in separate headers. If you don’t run Qt’s meta-object compiler (moc) for that source, the linker can’t find the metaobject/vtable symbols → undefined vtable refs.
Two easy fixes (pick one):
A) Include the generated moc at the end of the .cpp
Add this as the very last line of ui_qt.cpp:
cpp
Kopieren
Bearbeiten
#include "ui_qt.moc"
Then generate it before compiling:
sh
Kopieren
Bearbeiten
/path/to/qt6/bin/moc ui_qt.cpp -o ui_qt.moc
(Do the same for any other .cpp that contains Q_OBJECT in class definitions.)
B) Build moc outputs as separate objects
In your Makefile, add rules like:
make
Kopieren
Bearbeiten
QT_MOC := /path/to/qt6/bin/moc
INC := -I. -I/path/to/qt/include # add your include paths/defines
obj-750/moc_ui_qt.cpp: ui_qt.cpp
$(QT_MOC) $(INC) ui_qt.cpp -o $@
obj-750/moc_qt_widgets.cpp: qt/qt_widgets.h
$(QT_MOC) $(INC) qt/qt_widgets.h -o $@
OBJS += obj-750/moc_ui_qt.o obj-750/moc_qt_widgets.o
(Compile those .cpp into .o and add to your link line.)
Also double-check any other headers with Q_OBJECT (e.g. qt/qt_widgets.h) get their own moc_*.cpp generated/linked. Without the moc objects, you’ll keep seeing vtable/typeinfo undefineds for those classes.
--- snap ---