Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-55951

QOpenGLFunctions* classes cannot be used because of linking errors

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.7.0
    • GUI: OpenGL
    • None
    • Windows 7 64-bit Qt MinGW

    Description

      Code such as:

      QOpenGLFunctions_1_0_CoreBackend(QOpenGLContext *c)

      fails with a linking error:

      release/QtGui-inlines.o:QtGui-inlines.cpp:(.text$_ZN32QOpenGLFunctions_1_0_CoreBackendC2EP14QOpenGLContext[__ZN32QOpenGLFunctions_1_0_CoreBackendC2EP14QOpenGLContext]+0x11): undefined reference to `QOpenGLFunctions_1_0_CoreBackend::init()'
      

      My .pro file is:

      QT += gui opengl
      CONFIG += c++11
      TARGET = QtGui-inlines
      TEMPLATE = lib
      SOURCES += QtGui-inlines.cpp
      LIBS += -loleaut32 -lole32
      

      My cpp file is:

      #include <QtGui>
      
      extern "C" { void QtGui_inlines1402(void* instance, QOpenGLContext* c) { new (instance) QOpenGLFunctions_1_0_CoreBackend(c); } }
      

      I was forced to patch the header by adding {} after init() in the body of QT_OPENGL_DECLARE(FUNCTIONS) (line 130 at present).

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            seanharmer Sean Harmer
            ddobrev Dimitar Dobrev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes