Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Microsoft Compiler does not recognize #warning (specifically in qglfunctions.h)

Microsoft Compiler does not recognize #warning (specifically in qglfunctions.h)

Scheduled Pinned Locked Moved Installation and Deployment
2 Posts 2 Posters 968 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    davidwt
    wrote on last edited by
    #1

    I'm hoping that an existing Qt developer will be willing to submit the following patch so that a warning can be issued by any Microsoft C++ compiler, instead of an error about an unrecognized preprocessor command. This is regarding 4.8, but may also apply to 5.x.

    @diff --git a/src/opengl/qglfunctions.h b/src/opengl/qglfunctions.h
    index e142b1e..fce919e 100644
    --- a/src/opengl/qglfunctions.h
    +++ b/src/opengl/qglfunctions.h
    @@ -43,9 +43,14 @@
    #define QGLFUNCTIONS_H

    #ifdef GLEW_H
    +#ifdef _MSC_VER
    +#pragma message (FILE ": qglfunctions.h is not compatible with GLEW, GLEW defines will be undefined")
    +#pragma message (FILE ": To use GLEW with Qt, do not include <QtOpenGL> or <QGLFunctions> after glew.h")
    +#else
    #warning qglfunctions.h is not compatible with GLEW, GLEW defines will be undefined
    #warning To use GLEW with Qt, do not include <QtOpenGL> or <QGLFunctions> after glew.h
    #endif
    +#endif

    #include <QtOpenGL/qgl.h>

    @

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      There's already bug "here":https://bugreports.qt-project.org/browse/QTBUG-26326 concerning that problem.

      If you want, you can submit your patch through gerrit

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved