Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

glPointSize missing from Windows version, but present in Linux version



  • I'm developing an OpenGL based program that will run on both Windows and Linux Desktops. On Fedora Linux, using Qt (version 5.11.3) a program that contains the expression

    glPointSize(GLFloat(2.0f));   (or any other positive value)
    

    will compile, link and work perfectly. However in the Open source version for Windows (ver 5.13.0) with MSVC2015 on Windows 10 I get a link (NOT a compile) error:

    LNK2019: unresolved external symbol __imp_glPointSize referenced in function "public: virtual void __cdecl ViewDist::initializeGL(void)"
    

    gl_PointSize is not defined so it doesn't seem possible to use the geometry shader to set the point size.

    I've tried other versions of Qt and MSVC2017 with the same result. Any suggestions?


  • Lifetime Qt Champion

    @davidrs said in glPointSize missing from Windows version, but present in Linux version:

    gl_PointSize is not defined so

    It is defined, otherwise the compiler would complain. You simply don't link to a library which provides this function: https://docs.microsoft.com/en-us/windows/win32/opengl/glpointsize



  • @christian-ehrlicher
    You misunderstand - there are two separate commands: glPointSize which is usually in the initializeGL() section of your (C++) program and gl_pointSize which in the shader (vertex, tessellation or geometry).

    I am using the same Qt OpenGL program on 1) Fedora Linux and 2) Windows. In Linux the glPointSize command works perfectly, but on Windows I get the linking error indicating it is not in the Qt library. Since the Qt version of OpenGL is their own implementation it is not possible to link another version into the program.

    There is a solution - the point size can be set directly inside the vertex shader thus:

    gl_PointSize = 10;
     
    

    and the OpenGL property has to be enabled thus:

    glEnable(GL_PROGRAM_POINT_SIZE);
    

    This works on both systems.



  • This post is deleted!

Log in to reply