Qt World Summit: Register Today!

Resolving Qt <-> glew conflicts when using pch

  • Hi,

    I'm trying to incorporate precompiled headers into my project and am running into the problem of using Qt with glew. I.e. if I try to include <QtWidgets> inside my pch.h it will also include gl.h with QtOGL and throw errors when including glew in one of my files because gl.h has been included before.

    If I then try to include glew.h before any Qt includes in my pch, then Qt undefines all glew macros in qopenglfunctions.h and I'll get undefined symbol errors.

    Is there any way to get around this without disabling pch usage for all files that include glew.h?

Log in to reply