IENT / YUView

The Free and Open Source Cross Platform YUV Viewer with an advanced analytics toolset
http://ient.github.io/YUView
Other
1.92k stars 378 forks source link

Failure by linking with Qt6 on F40 #578

Closed 1div0 closed 3 months ago

1div0 commented 4 months ago

Describe the bug Linker command failed with following errors: cd YUViewApp/ && ( test -e Makefile || /bin/qmake6 -o Makefile /2TB/usr/src/github.com/IENT/YUView/YUViewApp/YUViewApp.pro -spec linux-clang-libc++ CONFIG+=debug ) && make -f Makefile make[1]: Entering directory '/2TB/usr/src/github.com/IENT/YUView/YUViewApp' clang++ -c -pipe -stdlib=libc++ -g -std=gnu++1z -Wall -Wextra -D_REENTRANT -DYUVIEW_VERSION=\"v2.14-70-g4b039328\" -DQT_WIDGETS_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_XML_LIB -DQT_CONCURRENT_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I../YUViewLib/src -I/usr/include/qt6 -I/usr/include/qt6/QtWidgets -I/usr/include/qt6/QtOpenGL -I/usr/include/qt6/QtGui -I/usr/include/qt6/QtXml -I/usr/include/qt6/QtConcurrent -I/usr/include/qt6/QtNetwork -I/usr/include/qt6/QtCore -I. -I/usr/lib64/qt6/mkspecs/linux-clang-libc++ -o yuviewapp.o src/yuviewapp.cpp clang++ -ccc-gcc-name g++ -stdlib=libc++ -Wl,-rpath-link,/usr/lib64 -o YUView yuviewapp.o -L/2TB/usr/src/github.com/IENT/YUView/YUViewLib -lYUViewLib /usr/lib64/libQt6Widgets.so /usr/lib64/libQt6OpenGL.so /usr/lib64/libQt6Gui.so /usr/lib64/libQt6Xml.so /usr/lib64/libQt6Concurrent.so /usr/lib64/libQt6Network.so /usr/lib64/libQt6Core.so -lpthread -lGLX -lOpenGL
/bin/ld: /2TB/usr/src/github.com/IENT/YUView/YUViewLib/libYUViewLib.a(Mainwindow.o): in function bool QMetaType::registerConverterImpl<std::__1::pair<int, int>, QtMetaTypePrivate::QPairVariantInterfaceImpl>(std::__1::function<bool (void const*, void*)>, QMetaType, QMetaType)': /usr/include/qt6/QtCore/qmetatype.h:652: undefined reference toQMetaType::registerConverterFunction(std::1::function<bool (void const, void)> const&, QMetaType, QMetaType)' /bin/ld: /2TB/usr/src/github.com/IENT/YUView/YUViewLib/libYUViewLib.a(PlaybackController.o): in function QBasicTimer::start(int, Qt::TimerType, QObject*)': /usr/include/qt6/QtCore/qbasictimer.h:54: undefined reference toQBasicTimer::start(std::1::chrono::duration<long long, std::__1::ratio<1l, 1000l> >, Qt::TimerType, QObject)' /bin/ld: /2TB/usr/src/github.com/IENT/YUView/YUViewLib/libYUViewLib.a(BitstreamAnalysisWidget.o): in function QtConcurrent::RunFunctionTaskBase<void>::run()': /usr/include/qt6/QtConcurrent/qtconcurrentrunbase.h:88: undefined reference toQUnhandledException::QUnhandledException(std::exception_ptr)' /bin/ld: /2TB/usr/src/github.com/IENT/YUView/YUViewLib/libYUViewLib.a(FFmpegVersionHandler.o): in function QString::toStdString() const': /usr/include/qt6/QtCore/qstring.h:1397: undefined reference toQByteArray::toStdString() const' /bin/ld: /2TB/usr/src/github.com/IENT/YUView/YUViewLib/libYUViewLib.a(playlistItemStatisticsFile.o): in function `QBasicTimer::start(int, QObject)': /usr/include/qt6/QtCore/qbasictimer.h:49: undefined reference to `QBasicTimer::start(std::1::chrono::duration<long long, std::1::ratio<1l, 1000l> >, QObject*)' clang++: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: [Makefile:69: YUView] Error 1 make[1]: Leaving directory '/2TB/usr/src/github.com/IENT/YUView/YUViewApp' make: [Makefile:73: sub-YUViewApp-make_first] Error 2

qmake6 -spec linux-clang-libc++ CONFIG+=debug

Version (please complete the following information):

1div0 commented 4 months ago

With qmake-qt5 -spec linux-clang-libc++ CONFIG+=debug

compilation and linking succeeded.

ChristianFeldmann commented 3 months ago

I can confirm this. But it also only happens with clang. GCC also compiles correctly.

ChristianFeldmann commented 3 months ago

I am wondering if this is a bug in clang / Qt or if this is a change in Qt where clang is just more strict then GCC is. This is definitely super strange. I can see these things that are failing:

ChristianFeldmann commented 3 months ago

Dockerfile to reproduce:

FROM fedora:40
RUN dnf install -y git qt6-qtbase-devel clang libcxx-devel

then run

qmake -spec linux-clang-libc++ ../../
make -j 12
ChristianFeldmann commented 3 months ago

So I was not able to track this down. For now my recommendation is, to compile with GCC. My best guess is, that something is not completely right with the type definitions in clang or how the defines are setup. For example, I could see that the QBasicTimer is now using std::chrono::milliseconds as a parameter. The type for this is defined as which is exactly what the linker is complaining about. So maybe the type here is defined differently for GCC? For GCC it looks like it is std::int64_t. Sorry but I will not further investigate this.

1div0 commented 3 months ago

@ChristianFeldmann Thank you for all your efforts. I will try to dig deeper.