PDA

View Full Version : Phonon and Static Qt Damn Problem!



srazi
7th June 2012, 15:54
I'm using ubuntu-11.04,
My application works good with shared version of Qt libs.
But there is a damn problem with statically linked version of Qt, indeed it compiles and links successfully but it can't run!!
I also test 'qmusicplayer' from Qt's example folder, message are similar with static version of Qt-4.6.2 and Qt-4.8.2:


srazi@SRazi-Linux:~/qmusicplayer$ ./qmusicplayer
WARNING: Phonon needs QCoreApplication::applicationName to be set to export audio output names through the DBUS interface
ASSERT: "QCoreApplication::instance()" in file ../../phonon/factory.cpp, line 378
Aborted
srazi@SRazi-Linux:~/qmusicplayer$

Please see the line 359:


// ../../phonon/factory.cpp
/* line 354 */ #ifndef QT_NO_DBUS
if (!QCoreApplication::instance() || QCoreApplication::applicationName().isEmpty()) {
pWarning() << "Phonon needs QCoreApplication::applicationName to be set to export audio output names through the DBUS interface";
}
#endif
/* line 359 */ Q_ASSERT(QCoreApplication::instance());
const QByteArray platform_plugin_env = qgetenv("PHONON_PLATFORMPLUGIN");
if (!platform_plugin_env.isEmpty()) {
QPluginLoader pluginLoader(QString::fromLocal8Bit(platform_plugi n_env.constData()));
if (pluginLoader.load()) {
m_platformPlugin = qobject_cast<PlatformPlugin *>(pluginLoader.instance());
if (m_platformPlugin) {
return m_platformPlugin;
}
}
}
const QString suffix(QLatin1String("/phonon_platform/"));
ensureLibraryPathSet();
QDir dir;
dir.setNameFilters(
!qgetenv("KDE_FULL_SESSION").isEmpty() ? QStringList(QLatin1String("kde.*")) :
(!qgetenv("GNOME_DESKTOP_SESSION_ID").isEmpty() ? QStringList(QLatin1String("gnome.*")) :
QStringList())
);
/* line 378 */ dir.setFilter(QDir::Files);

what's going wrong here? Why (and how?!!!!!!!!!!) 'QCoreApplication::instance()' at line 359 return NULL?
:confused: