Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Public export of defines from QT6:Platform polutes my build
Forum Updated to NodeBB v4.3 + New Features

Public export of defines from QT6:Platform polutes my build

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 4 Posters 420 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.
  • T Offline
    T Offline
    Thestrup
    wrote on last edited by
    #1

    I've have a project in which I use OpenNURBS. We are in the process of upgrading to QT6.5.3 from QT5.15.2 and I'm having massive problems getting that to work with OpenNURBS
    The reason is that OpenNURBS has the following check:

    #if defined(_WIN32) || defined(WIN32) || defined(_WIN64) || defined(WIN64)
    
    #if defined(_M_X64) && defined(WIN32) && defined(WIN64)
    // 23 August 2007 Dale Lear
    
    #if defined(_INC_WINDOWS)
    // The user has included Microsoft's windows.h before opennurbs.h,
    // and windows.h has nested includes that unconditionally define WIN32.
    // Just undo the damage here or everybody that includes opennurbs.h after
    // windows.h has to fight with this Microsoft bug.
    #undef WIN32
    #else
    #error do not define WIN32 for x64 builds
    #endif
    

    In QT5.15.2 only WIN32 was leaked from QT6:Platform and thus it didn't give us any problems, but with the upgrade both WIN32 and WIN64 are leaked which makes the check above fail. I've tried a lot of things to remove that define (it's from QT6Targets.cmake line 62), but it keeps sneaking into my OpenNURBS target.

    I'm running out of talent, both regarding CMake and QT so I'm hoping that some of you might have encountered this and knows how to get around it?

    In this link: Similar problem it is actually suggested that it is a bug in QTs CMake setup?

    Christian EhrlicherC C 2 Replies Last reply
    0
    • T Thestrup

      I've have a project in which I use OpenNURBS. We are in the process of upgrading to QT6.5.3 from QT5.15.2 and I'm having massive problems getting that to work with OpenNURBS
      The reason is that OpenNURBS has the following check:

      #if defined(_WIN32) || defined(WIN32) || defined(_WIN64) || defined(WIN64)
      
      #if defined(_M_X64) && defined(WIN32) && defined(WIN64)
      // 23 August 2007 Dale Lear
      
      #if defined(_INC_WINDOWS)
      // The user has included Microsoft's windows.h before opennurbs.h,
      // and windows.h has nested includes that unconditionally define WIN32.
      // Just undo the damage here or everybody that includes opennurbs.h after
      // windows.h has to fight with this Microsoft bug.
      #undef WIN32
      #else
      #error do not define WIN32 for x64 builds
      #endif
      

      In QT5.15.2 only WIN32 was leaked from QT6:Platform and thus it didn't give us any problems, but with the upgrade both WIN32 and WIN64 are leaked which makes the check above fail. I've tried a lot of things to remove that define (it's from QT6Targets.cmake line 62), but it keeps sneaking into my OpenNURBS target.

      I'm running out of talent, both regarding CMake and QT so I'm hoping that some of you might have encountered this and knows how to get around it?

      In this link: Similar problem it is actually suggested that it is a bug in QTs CMake setup?

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Fix OpenNURBS. Or convince MS to change it: https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=msvc-170#microsoft-specific-predefined-macros

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      0
      • T Thestrup

        I've have a project in which I use OpenNURBS. We are in the process of upgrading to QT6.5.3 from QT5.15.2 and I'm having massive problems getting that to work with OpenNURBS
        The reason is that OpenNURBS has the following check:

        #if defined(_WIN32) || defined(WIN32) || defined(_WIN64) || defined(WIN64)
        
        #if defined(_M_X64) && defined(WIN32) && defined(WIN64)
        // 23 August 2007 Dale Lear
        
        #if defined(_INC_WINDOWS)
        // The user has included Microsoft's windows.h before opennurbs.h,
        // and windows.h has nested includes that unconditionally define WIN32.
        // Just undo the damage here or everybody that includes opennurbs.h after
        // windows.h has to fight with this Microsoft bug.
        #undef WIN32
        #else
        #error do not define WIN32 for x64 builds
        #endif
        

        In QT5.15.2 only WIN32 was leaked from QT6:Platform and thus it didn't give us any problems, but with the upgrade both WIN32 and WIN64 are leaked which makes the check above fail. I've tried a lot of things to remove that define (it's from QT6Targets.cmake line 62), but it keeps sneaking into my OpenNURBS target.

        I'm running out of talent, both regarding CMake and QT so I'm hoping that some of you might have encountered this and knows how to get around it?

        In this link: Similar problem it is actually suggested that it is a bug in QTs CMake setup?

        C Offline
        C Offline
        ChrisW67
        wrote on last edited by
        #3

        @Thestrup Given the message in the OpenNurbs header it seems straightforward enough, in your source code make sure that you #include <opennurbs.h> before you #include anything from Qt or the Windows SDK.

        1 Reply Last reply
        1
        • A Offline
          A Offline
          aleclouisgrant
          wrote last edited by
          #4

          Did you ever have any luck getting this to work? Running into the same issue and bashing my keyboard into the wall hasn't made me any headway, surprisingly.

          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