Opened 4 years ago

Closed 3 years ago

#17639 closed defect (fixed)

Version 3.0.2 fails to compile on OS X Sierra: request to backport fixes for mediactrl

Reported by: mojca Owned by:
Priority: normal Milestone: 3.0.3
Component: wxOSX Version: 3.0.2
Keywords: Cc:
Blocked By: Blocking:
Patch: no


In MacPorts we are packaging wxWidgets 3.0.2 for all available platforms (from 10.5 to 10.12). Unfortunately it no longer compiles on 10.12 due to some minor problems that have already been fixed in master in the meantime.

The first fix required is

and I can easily apply that one.

The second problem is QTKit. In the master branch one can already use AV Foundation instead of QTKit, but I'm not confident enough in backporting the patch, so the only easy workaround for us is to disable mediactrl completely.

I would be grateful if the functional patches could be backported to a stable release (I can also fetch them from a 3.0 branch if needed).

See for details.

Change History (11)

comment:1 Changed 4 years ago by Vadim Zeitlin <vadim@…>

In 817bd0076f61ed96694ec6cebba46ca5df495998/git-wxWidgets:

Don't include QuickTime headers unnecessarily

This should fix compilation under macOS Sierra (10.12).

See #17639.

(cherry picked from commit f6a2d1caef5c6d412c84aa900cb0d3990b350938)

comment:2 Changed 4 years ago by vadz

  • Status changed from new to infoneeded_new

Sorry, I'm not sure what needs to be done here. I've applied the fix you mentioned, but I don't know what else could/should be done, could you please explain which "functional patches" did you have in mind?

comment:3 Changed 4 years ago by mojca

  • Status changed from infoneeded_new to new

Once the patch you just backported is added, wxWidgets fails with:

../src/osx/cocoa/ fatal error: 'QTKit/QTKit.h' file not found
#include <QTKit/QTKit.h>

The master branch can switch between the deprecated QtKit and AV Foundation, but the branch 3.0 cannot.

A "workaround" is to--disable-mediactrl to allow wxWidgets to build at all, but that's just a temporary solution.

The relevant code from master is this:

#ifndef wxOSX_USE_QTKIT
    #if wxOSX_USE_IPHONE
        #define wxOSX_USE_QTKIT 0
        #define wxOSX_USE_AVFOUNDATION 1
        #define wxOSX_USE_QTKIT 1
        #define wxOSX_USE_AVFOUNDATION 0
    #if wxOSX_USE_QTKIT
        #define wxOSX_USE_AVFOUNDATION 0
        #define wxOSX_USE_AVFOUNDATION 1

    #define wxOSX_USE_AVKIT 1
    #define wxOSX_USE_AVKIT 0


#include <QTKit/QTKit.h>

#import <AVFoundation/AVFoundation.h>

#import <AVKit/AVKit.h>
// ...

In WX_3_0_BRANCH it's just:


#include "wx/mediactrl.h"
// ...
#include <QTKit/QTKit.h>

and #include <QTKit/QTKit.h> cannot be honoured in 10.12, while master allows using another backend.

It might be enough to just copy src/osx/cocoa/ from master to WX_3_0_BRANCH, I don't know. I would have to ask users of Sierra to help testing (or boot up my machine from USB stick containing 10.12, but that's awfully slow).

I don't know if switching to AVKIT is done automatically on Sierra. All my observations are based solely on reading the sources (and assuming that the one who added support for AVKIT to wxWidgets must have tested that on some recent version of OS X) and from getting confirmation of Sierra users that disabling that module helped.

comment:4 Changed 4 years ago by vadz

The simplest fix I see is to add a test to <QTKit/QTKit.h> to configure. If it fails, mediactrl would be disabled, thus fixing the build on 10.12, while still allowing to use it on older systems.

Could you please do and test this? TIA!

comment:5 Changed 4 years ago by vadz

  • Resolution set to port to stable
  • Status changed from new to portneeded

Done in dda1c7cfd4c353377d0e2a86d0a283f691cf672c in the trunk, please try backporting (and testing) this to 3.0. TIA!

comment:6 Changed 4 years ago by mojca

Seeing I got the impression that support for < 10.9 has now been dropped from master?

Of course this doesn't prevent me from including just the relevant patches, I just don't quite understand the reasoning behind those other commits (it started with "we only support 10.7 and newer anyway" and then "so we can live with 10.9+ avkit only").

I was slightly hoping to get some configuration option to switch between the two rather than just testing, but if you decided to drop QTKit completely, this is a moot point anyway.

comment:7 Changed 4 years ago by vadz

No, it should still work on 10.7 (but testing it would be, of course, appreciated).

comment:8 Changed 4 years ago by mojca

This is just to confirm that master compiles on 10.7 as expected.

comment:9 Changed 4 years ago by TcT

Please see PR which should fix the issue for 3.0 branch.

I've already tested it with 10.12 SDK, somebody should test it with older SDKs which still contain QTKit.

comment:10 Changed 4 years ago by Tobias Taschner <TcT2k@…>

In 4dad61831a1c377e2b1c77eefabad67606781254/git-wxWidgets:

Added --disable-qtkit to force usage of AVFoundation

See #17639

comment:11 Changed 3 years ago by vadz

  • Resolution changed from port to stable to fixed
  • Status changed from portneeded to closed

AFAICS this was fixed, so closing -- please reopen if I was wrong.

Note: See TracTickets for help on using tickets.