Move GLX calls into plain C compilation unit and provide wrappers for needed calls in order to avoid its horrible #define contamination.
Undefine min and max before including Qt headers.