Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Ошибка линковки при включенном opengl
-
строка configure
@PKG_CONFIG="/home/legath/fitness/buildrootng/output/host/usr/bin/pkg-config" PKG_CONFIG_LIBDIR="/home/legath/fitness/buildrootng/output/host/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/pkgconfig"
PKG_CONFIG_SYSROOT_DIR="/home/legath/fitness/buildrootng/output/host/usr/arm-buildroot-linux-gnueabihf/sysroot" MAKEFLAGS=" -j9"
./configure -v -prefix /usr -hostprefix /home/legath/fitness/buildrootng/output/host/usr -headerdir /usr/include/qt5
-sysroot /home/legath/fitness/buildrootng/output/host/usr/arm-buildroot-linux-gnueabihf/sysroot
-plugindir /usr/lib/qt/plugins -examplesdir /usr/lib/qt/examples -no-rpath
-nomake tests -device buildroot -device-option CROSS_COMPILE=" /home/legath/fitness/buildrootng/output/host/usr/bin/arm-linux-gnueabihf-"
-device-option BR_COMPILER_CFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-pipe -Os " -device-option BR_COMPILER_CXXFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -pipe -Os "
-device-option EGLFS_PLATFORM_HOOKS_SOURCES="" -optimized-qmake -no-kms -no-cups -no-nis -no-iconv
-system-zlib -system-pcre -no-pch -release -shared -largefile -opensource -confirm-license -gui
-widgets -no-linuxfb -no-directfb -xcb -system-xkbcommon -opengl es2
-no-eglfs -openssl -no-fontconfig -system-libjpeg -system-libpng -no-dbus -no-tslib -glib -no-icu -nomake examples@Текст ошибки
@.obj/qopenglwidget.o: In function
QOpenGLWidget::resizeEvent(QResizeEvent*)': qopenglwidget.cpp:(.text+0x1fc): undefined reference to
QOpenGLContext::makeCurrent(QSurface*)'
qopenglwidget.cpp:(.text+0x2d0): undefined reference toQOpenGLFramebufferObject::QOpenGLFramebufferObject(QSize const&, QOpenGLFramebufferObject::Attachment, unsigned int, unsigned int)' qopenglwidget.cpp:(.text+0x2dc): undefined reference to
QOpenGLFramebufferObject::bind()'
qopenglwidget.cpp:(.text+0x2e4): undefined reference toQOpenGLContext::functions() const' .obj/qopenglwidget.o: In function
QOpenGLWidget::QOpenGLWidget(QWidget*, QFlagsQt::WindowType)':
qopenglwidget.cpp:(.text+0x3d8): undefined reference toQOpenGLContext::QOpenGLContext(QObject*)' .obj/qopenglwidget.o: In function
QOpenGLWidget::isValid() const':
qopenglwidget.cpp:(.text+0x4b8): undefined reference toQOpenGLContext::isValid() const' .obj/qopenglwidget.o: In function
QOpenGLWidget::makeCurrent()':
qopenglwidget.cpp:(.text+0x4e4): undefined reference toQOpenGLContext::makeCurrent(QSurface*)' qopenglwidget.cpp:(.text+0x4f0): undefined reference to
QOpenGLFramebufferObject::bind()'
.obj/qopenglwidget.o: In functionQOpenGLWidget::doneCurrent()': qopenglwidget.cpp:(.text+0x4fc): undefined reference to
QOpenGLContext::doneCurrent()'
.obj/qopenglwidget.o: In functionQOpenGLWidget::defaultFramebufferObject() const': qopenglwidget.cpp:(.text+0x54c): undefined reference to
QOpenGLFramebufferObject::handle() const'
.obj/qopenglwidget.o: In functionQOpenGLWidget::updateGL()': qopenglwidget.cpp:(.text+0x598): undefined reference to
QOpenGLContext::functions() const'
.obj/qopenglwidget.o: In functionQOpenGLWidgetPrivate::textureId() const': qopenglwidget.cpp:(.text._ZNK20QOpenGLWidgetPrivate9textureIdEv[_ZNK20QOpenGLWidgetPrivate9textureIdEv]+0xc): undefined reference to
QOpenGLFramebufferObject::texture() const'
.obj/qopenglwidget.o: In functionQOpenGLWidgetPrivate::~QOpenGLWidgetPrivate()': qopenglwidget.cpp:(.text._ZN20QOpenGLWidgetPrivateD2Ev[_ZN20QOpenGLWidgetPrivateD5Ev]+0x18): undefined reference to
QOpenGLContext::~QOpenGLContext()'
.obj/qopenglwidget.o: In functionQOpenGLWidgetPrivate::~QOpenGLWidgetPrivate()': qopenglwidget.cpp:(.text._ZN20QOpenGLWidgetPrivateD0Ev[_ZN20QOpenGLWidgetPrivateD0Ev]+0x18): undefined reference to
QOpenGLContext::~QOpenGLContext()'@
-
если собирал qmake там должно быть такое
Header: #include <QOpenGLContext>
qmake: QT += gui
или попробуй собрать любой пример с классом QOpenGLContext
не соберется значит разные версии
-
собственно в мануалу к нему это возможность не исключена.
этот класс просто обертка для апи самого джиэла. для OpenGL 1.x or OpenGL ES 1.x. придется использовать апи напрямую. либо откатывать версию кутишной либы, ноэто может привести к нестыковке уже на уровне старых и новых модулей кути.
кресты вообще всегда тяжело линкуются, даже отличия в компиляторе или его опциях сказываются печально. Правда если сигнатуры класса QOpenGLContext не изменились его можно попробовать собрать с аналог. параметрами что и гл, может помочь.
-
This post is deleted!
-
This post is deleted!