Menu

Compile PythonQt 3.1 on macOS Sierra fails

Help
2016-12-13
2016-12-23
  • Rainer Goebel

    Rainer Goebel - 2016-12-13

    I tried to compile PythonQt 3.1 on macOS Sierra (XCode 8.2) but got the following error message:

    In file included from PythonQtClassInfo.cpp:42:
    In file included from ./PythonQtClassInfo.h:41:
    In file included from ./PythonQt.h:59:
    In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iostream:38:
    In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios:216:
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale:468:15: error:
    C++ requires a type specifier for all declarations
    char_type toupper(char_type
    c) const
    ^
    /System/Library/Frameworks/Python.framework/Headers/pyport.h:731:29: note: expanded from macro 'toupper'
    define toupper(c) towupper(btowc(c))

    followed by many more. It seems that there is some conflct with macro definitions (e.g. "toupper") in the new macOS Python framework.

    Any help would be highly appreciated!

     
  • Rainer Goebel

    Rainer Goebel - 2016-12-22

    Some digging revealed that this is apparently an old issue with a fix that went in to pyport.h for issues with isspace/toupper/et al. on FreeBSD's libc and Mac OS X. The good news is that it can easily be fixed by including <python.h> into the following PythonQt files (I added them as the first include):

    • PythonQtClassInfo.cpp
    • PythonQtMethodInfo.cpp

    With these little changes PythonQt 3.1 compiles and works fine on macOS 10.12 Sierra (tested with Qt 5.7.1).

    Regards,

    Rainer

     
  • Florian Link

    Florian Link - 2016-12-23

    Ok, I will add that to the svn trunk. Thanks for posting your findings.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.