我尝试运行声音示例代码,音乐播放器示例,随附sdk。它在Windows上运行良好,但在Mac OS Snow Leopard 10.6.8上启动时崩溃。这是崩溃细节:
崩溃线:
audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
崩溃日志和调用堆栈:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0×0000000000000008
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 QtCore 0×0000000100e9c8f2 QObject::moveToThread(QThread*) + 34
1 QtDBus 0×00000001010b4912 _q_sessionBus() + 162
2 QtDBus 0×00000001010b4a71 QDBusConnection::sessionBus() + 17
3 phonon 0×000000010001beab Phonon::FactoryPrivate::FactoryPrivate() + 219
4 phonon 0×000000010001edc2 Phonon::Factory::registerFrontendObject(Phonon::MediaNodePrivate*) + 146
5 phonon 0×0000000100028f92 Phonon::MediaNodePrivate::MediaNodePrivate(Phonon::MediaNodePrivate::CastId) + 82
6 phonon 0×00000001000137bf Phonon::AudioOutput::AudioOutput(Phonon::Category, QObject*) + 63
7 com.yourcompany.qmusicplayer 0×00000001000026cc MainWindow::MainWindow() + 108
8 com.yourcompany.qmusicplayer 0×00000001000024a2 main + 114
9 com.yourcompany.qmusicplayer 0×0000000100002404 start + 52
答案 0 :(得分:1)
我认为这是Qt 4.8.0的问题。它需要在您的机器上安装dbus。有一些解决方法,比如在你的机器上安装dbus或用补丁重建Qt,但我相信它已在Qt 4.8.1中修复,所以可能只是使用它。