Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Mac Application Build Fails When Linking QtAccessibleWidgets
Mark Snuffin last edited by
I'm evaluating accessibility on the Mac using Qt and have run into a problem getting a test application to build. The app is based on the stylesheet example and I'm just trying to rebuild it with accessibility. The demo version of stylesheet doesn't work at all with Mac VoiceOver but Qt docs state that accessibility is available using the Carbon-based Qt package. I'm trying to verify this but no joy thus far.
The build error is Undefined symbols for architecture i386 qt_plugin_instance_qtaccessiblewidgets()", referenced from:... with a snip from the compile output below:
g++ -headerpad_max_install_names -arch i386 -o stylesheet.app/Contents/MacOS/stylesheet main.o mainwindow.o stylesheeteditor.o moc_mainwindow.o moc_stylesheeteditor.o qrc_stylesheet.o -F/Library/Frameworks -L/Library/Frameworks -L/Developer/Applications/Qt/plugins/accessible -lqtaccessiblewidgets -framework QtGui -framework QtCore
Undefined symbols for architecture i386:
"qt_plugin_instance_qtaccessiblewidgets()", referenced from:
__static_initialization_and_destruction_0(int, int)in main.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
make: *** [stylesheet.app/Contents/MacOS/stylesheet] Error 1
make: Leaving directory `/Users/marksnuffin/Desktop/stylesheet-build-desktop'
The process "/usr/bin/make" exited with code 2.
Error while building project stylesheet (target: Desktop)
When executing build step 'Make'
Some additional details -
- Installed the Carbon: Mac binary package for Mac OS X 10.4 - 10.6 (32-bit Intel/PPC)
- Installed Qt Creator 2.2
- Using a MacBook Pro with OSX 10.6 x64
The File utility reports the following for the Accessible plug-in:
libqtaccessiblewidgets.dylib: Mach-O universal binary with 2 architectures
libqtaccessiblewidgets.dylib (for architecture i386): Mach-O dynamically linked shared library i386
libqtaccessiblewidgets.dylib (for architecture ppc): Mach-O dynamically linked shared library ppc
I've experimented with a number of compiler options with the following in my pro file now:
CFLAGS += -mmacosx-version-min=10.6
macx:CONFIG -= x86_64 ppc64
macx:CONFIG += x86
QTPLUGIN += qtaccessiblewidgets
Does anyone have any suggestions to resolve this problem?