Skip to content

Buidling fails on Windows 11 Qt 6.8.2Β #4256

Closed

Description

@Atque

Building fails on my Windows 11 using Qt 6.8.2. Build output reads as:

C:\Users\birge\Documents\DEV\MASTER\stellarium-master\src\core\modules\Planet.cpp(3517): error C2065: 'APIENTRY': undeclared identifier
C:\Users\birge\Documents\DEV\MASTER\stellarium-master\src\core\modules\Planet.cpp(3517): error C2275: 'GLenum': expected an expression instead of a type
C:\Users\birge\Documents\DEV\MASTER\stellarium-master\src\core\modules\Planet.cpp(3517): warning C4353: nonstandard extension used: constant 0 as function expression. Use '__noop' function intrinsic instead
C:\Users\birge\Documents\DEV\MASTER\stellarium-master\src\core\modules\Planet.cpp(3517): error C2066: cast to function type is illegal
C:\Users\birge\Documents\DEV\MASTER\stellarium-master\src\core\modules\Planet.cpp(3517): error C2440: 'reinterpret_cast': cannot convert from 'QFunctionPointer' to 'void (GLenum)'
C:\Users\birge\Documents\DEV\MASTER\stellarium-master\src\core\modules\Planet.cpp(3517): note: There are no conversions to function types, although there are conversions to references or pointers to functions
C:\Users\birge\Documents\DEV\MASTER\stellarium-master\src\core\modules\Planet.cpp(3518): error C2065: 'APIENTRY': undeclared identifier
C:\Users\birge\Documents\DEV\MASTER\stellarium-master\src\core\modules\Planet.cpp(3518): error C2275: 'GLenum': expected an expression instead of a type
C:\Users\birge\Documents\DEV\MASTER\stellarium-master\src\core\modules\Planet.cpp(3518): warning C4353: nonstandard extension used: constant 0 as function expression. Use '__noop' function intrinsic instead
C:\Users\birge\Documents\DEV\MASTER\stellarium-master\src\core\modules\Planet.cpp(3518): error C2066: cast to function type is illegal
C:\Users\birge\Documents\DEV\MASTER\stellarium-master\src\core\modules\Planet.cpp(3518): error C2440: 'reinterpret_cast': cannot convert from 'QFunctionPointer' to 'void (GLenum)'
C:\Users\birge\Documents\DEV\MASTER\stellarium-master\src\core\modules\Planet.cpp(3518): note: There are no conversions to function types, although there are conversions to references or pointers to functions

It appears the commit e4e2a22 causes this.

Am I missing some dependency?

Activity

  1. 10110111 commented on Mar 29, 2025

    @10110111
    Contributor

    What if you try this?

    diff --git a/src/core/modules/Planet.cpp b/src/core/modules/Planet.cpp
    index cdb5cfbb47..43260369f6 100644
    --- a/src/core/modules/Planet.cpp
    +++ b/src/core/modules/Planet.cpp
    @@ -3514,8 +3514,8 @@ bool Planet::initFBO()
                 // Use DrawBuffer instead of DrawBuffers because it is available since GL 1.0 instead of only on 3+
                 // Resolve them manually, because while they are present since 1.0,
                 // they are not found by QOpenGLFunctions_1_0 when in Core profile
    -            void (APIENTRYP glDrawBuffer)(GLenum) = reinterpret_cast<decltype(glDrawBuffer)>(ctx->getProcAddress("glDrawBuffer"));
    -            void (APIENTRYP glReadBuffer)(GLenum) = reinterpret_cast<decltype(glReadBuffer)>(ctx->getProcAddress("glReadBuffer"));
    +            void (GLAPIENTRY* glDrawBuffer)(GLenum) = reinterpret_cast<decltype(glDrawBuffer)>(ctx->getProcAddress("glDrawBuffer"));
    +            void (GLAPIENTRY* glReadBuffer)(GLenum) = reinterpret_cast<decltype(glReadBuffer)>(ctx->getProcAddress("glReadBuffer"));
     
                 glDrawBuffer(GL_NONE);
                 glReadBuffer(GL_NONE);
  2. Atque commented on Mar 29, 2025

    @Atque
    ContributorAuthor

    @10110111 No luck, but adding #include <windows.h> as suggested by @uwes-ufo works.

  3. 10110111 commented on Mar 29, 2025

    @10110111
    Contributor

    Hmm, strange. But including <windows.h> is a hack that shouldn't be required.

  4. 10110111 commented on Mar 29, 2025

    @10110111
    Contributor

    Generally, APIENTRY should be defined by qopengl.h, which is included by Planet.hpp. I wonder how this identifier fails to be defined.

  5. gzotti commented on Mar 29, 2025

    @gzotti
    Member

    It's weird, at the end of qopengl.h it becomes undefined!

    If I add this after all includes in Planet.cpp, it works (but is there a non-hacked solution?)

    #ifndef APIENTRY
    #define APIENTRY
    #endif
    #ifndef APIENTRYP
    #define APIENTRYP APIENTRY *
    #endif
    
  6. uwes-ufo commented on Mar 29, 2025

    @uwes-ufo
    Contributor

    QOPENGLF_APIENTRYP seems to work. #3763

  7. added this to the 25.2 milestone on Mar 29, 2025
  8. added theissue type on Mar 29, 2025
  9. added a commit that references this issue on Mar 29, 2025
    0573be4
  10. reopened this on Mar 29, 2025
  11. added
    state: publishedThe fix has been published for testing in weekly binary package
    on Mar 30, 2025
  12. github-actions commented on Mar 30, 2025

    @github-actions

    Hello @Atque!

    Please check the fresh version (development snapshot) of Stellarium:
    https://github.com/Stellarium/stellarium-data/releases/tag/weekly-snapshot

  13. removed
    state: publishedThe fix has been published for testing in weekly binary package
    on Jun 22, 2025
  14. github-actions commented on Jun 22, 2025

    @github-actions

    Hello @Atque!

    Please check the latest stable version of Stellarium:
    https://github.com/Stellarium/stellarium/releases/latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions