Important: Please read the Qt Code of Conduct -

QT 5 compile fails with undefined symbols for x86_64 on OS X

  • I having an issue compiling QT 5.0, where it eventually errors out due to undefined symbols for x86_64.

    Undefined symbols for architecture x86_64:
    "_XSetErrorHandler", referenced from:
    QGtkStylePrivate::initGtkWidgets() const in qgtkstyle_p.o
    "_XSetTransientForHint", referenced from:
    QGtkStylePrivate::setupGtkFileChooser(_GtkWidget*, QWidget*, QString const&, QString const&, QString*, QFlagsQFileDialog::Option, bool, QHash<_GtkFileFilter*, QString>*) in qgtkstyle_p.o
    ld: symbol(s) not found for architecture x86_64

    Anyone see this before?

    Compiling previous versions of QT don't have this issue.

  • Moderators

    Did not get this particular one. Occasionally, though, symbols not found does happen due to Apple's shamefully outdated tools and qmake's archaic macx-xcode specs.

    Several things that might help:

    • which version of Mac OS, Xcode do you have?
    • change the mkspecs to macx-llvm (in configure, that's -platform macx-llvm, in qmake: -spec macx-xcode)
    • force Mac to use g++ as linker (Apple's ln is a bit flawed ere and there)
    • pass -no-gtkstyle to configure

  • i'm running OS X 10.8.2 and Xcode 4.5.2.

    I'd be interested to know how others with this configuration have successfully compiled QT 5.0.

Log in to reply