Qt 5.9.2 build error (Mac)



  • I can't seem to get Qt 5.9.2 to build...

    qtbase/src/corelib/kernel/qcore_foundation.mm:491:13: error: static_cast from 'CFTimeZoneRef' (aka 'const __CFTimeZone *') to
          'NSTimeZone *' is not allowed
        return [static_cast<NSTimeZone *>(toCFTimeZone()) autorelease];
    

    The code for method:

    NSTimeZone *QTimeZone::toNSTimeZone() const
    {
    	return [static_cast<NSTimeZone *>(toCFTimeZone()) autorelease];
    }
    

    is the same up to the latest Qt so I'm guessing the problem is with my specific compiler/os. Has anybody else run across this issue? Is there a possible workaround that only involves a code change (and not upgrading OS/compiler)? I'm willing to remove any feature or module needed to get this built.

    The Apple Developer documentation says that NSTimeZone and CFTimeZoneRef are interchangeable but I'm not at all familiar with Objective-C.

    I have also tried disabling timezone features while configuring but it leads to even more build errors. I noticed that the code always checks for

    !defined(QT_NO_SYSTEMLOCALE)
    

    but I can't find where to set that while configuring.

    OS x 10.9 / Xcode 6.2


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    IIRC you are running a too old version of macOS and Xcode, the current supported list is 10.10 - 10.13.

    You can try to replace static_cast with reinterpret_cast.



  • I've already tried that.

    I'd love to be able to just 86 the whole locale/timezone code but it seems to break more stuff.

    And by the way these OS and XCode upgrade requirements are really annoying.


  • Lifetime Qt Champion

    @ChristopherL said in Qt 5.9.2 build error (Mac):

    I'd love to be able to just 86 the whole locale/timezone code but it seems to break more stuff.

    What do you mean by that ?

    @ChristopherL said in Qt 5.9.2 build error (Mac):
    And by the way these OS and XCode upgrade requirements are really annoying.

    Tell that to Apple, they officially support the 3 last versions of their OS. If you need support for older versions, then you should consider the 5.6 series.



  • @SGaist said in Qt 5.9.2 build error (Mac):

    @ChristopherL said in Qt 5.9.2 build error (Mac):

    I'd love to be able to just 86 the whole locale/timezone code but it seems to break more stuff.

    What do you mean by that ?

    I mean that I can get Qt 5.8 to build just fine because it doesn't have that bug I mentioned that's stopping me from building 5.9.

    @ChristopherL said in Qt 5.9.2 build error (Mac):
    And by the way these OS and XCode upgrade requirements are really annoying.

    Tell that to Apple, they officially support the 3 last versions of their OS. If you need support for older versions, then you should consider the 5.6 series.

    Thanks. I'll take a look at 5.6 next..


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.