Opened 14 years ago
Closed 14 years ago
Last modified 14 years ago
#8572 closed defect (fixed)
Fix MythTV for Qt 4.7 compatibility
Reported by: | databubble | Owned by: | sphery |
---|---|---|---|
Priority: | minor | Milestone: | 0.23-fixes |
Component: | MythTV - General | Version: | Master Head |
Severity: | medium | Keywords: | trunk |
Cc: | Ticket locked: | no |
Description (last modified by )
I've been building 0.23-fixes and trunk fine on ubuntu 10.4, however, I recently enabled the kubuntu beta ppc (ppa:kubuntu-ppa/beta) to test KDE Software Compilation 4.5 Beta 2.
Since then, both trunk (25125) and 0.23-fixes are failing to build, as follows:
make[2]: Entering directory `/home/local/src/mythtv/trunk/mythtv/libs/libmythupnp' ccache g++ -c -pipe -fomit-frame-pointer -O3 -g -Wall -Wno-switch -Wpointer-arith -Wredundant-decls -Wno-non-virtual-dtor -funit-at-a-time -D__STDC_CONSTANT_MACROS -D_REENTRANT -DPIC -fPIC -DMMX -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DQT_NO_DEBUG -DQT_SQL_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtSql -I/usr/include/qt4 -I/usr/include -I/usr -I../libmythdb -I.. -I. -o upnpcmgr.o upnpcmgr.cpp In file included from upnpcmgr.h:29, from upnpcmgr.cpp:26: eventing.h: In member function ‘T StateVariables::GetValue(const QString&) [with T = QString]’: upnpcmgr.cpp:69: instantiated from here eventing.h:236: error: call of overloaded ‘QString(int)’ is ambiguous /usr/include/qt4/QtCore/qstring.h:428: note: candidates are: QString::QString(const QByteArray&) /usr/include/qt4/QtCore/qstring.h:426: note: QString::QString(const char*) /usr/include/qt4/QtCore/qstring.h:727: note: QString::QString(const QString&) /usr/include/qt4/QtCore/qstring.h:106: note: QString::QString(QChar) /usr/include/qt4/QtCore/qstring.h:105: note: QString::QString(const QChar*) eventing.h:244: error: call of overloaded ‘QString(int)’ is ambiguous /usr/include/qt4/QtCore/qstring.h:428: note: candidates are: QString::QString(const QByteArray&) /usr/include/qt4/QtCore/qstring.h:426: note: QString::QString(const char*) /usr/include/qt4/QtCore/qstring.h:727: note: QString::QString(const QString&) /usr/include/qt4/QtCore/qstring.h:106: note: QString::QString(QChar) /usr/include/qt4/QtCore/qstring.h:105: note: QString::QString(const QChar*) make[2]: *** [upnpcmgr.o] Error 1 make[2]: Leaving directory `/home/local/src/mythtv/trunk/mythtv/libs/libmythupnp' make[1]: *** [sub-libmythupnp-make_default] Error 2 make[1]: Leaving directory `/home/local/src/mythtv/trunk/mythtv/libs' make: *** [sub-libs-make_default-ordered] Error 2
I'm guessing the failure is related to the use of Qt 4.7.0 beta (4:4.7.0~beta1+git20100522-0ubuntu1~lucid1~ppa1).
Attachments (4)
Change History (19)
comment:1 Changed 14 years ago by
comment:2 Changed 14 years ago by
I had a look at the code where the build is failing. I'm not a programmer, but it looks to me like the function is looking up value from an array using a string name/index. If the string isn't found, it should be returning a 0 or false or something (I think), but instead it seems to by trying to lookup the value of a null character - definitely odd, and I can see why the compiler is throwing a wobbly.
If I change the two cases of "return T(0);" to "return 0" it compiles... but I don't know if is the intended return value.
I'm sure any real programmer can look at this and, in just a couple of seconds, say what the function should be returning, so that I can build 0.23-fixes and trunk again....
From mythtv/libs/libmythupnp/eventing.h (lines 236 & 244).
template < class T > T GetValue( const QString &sName ) { SVMap::iterator it = m_map.find(sName); if (it == m_map.end()) return T(0); StateVariable< T > *pVariable = dynamic_cast< StateVariable< T > *>( *it ); if (pVariable != NULL) return pVariable->GetValue(); return T(0); }
comment:4 Changed 14 years ago by
Status: | new → infoneeded_new |
---|
Can you try rebuilding after changing:
return T(0);
on lines 236 and 244 of mythtv/libs/libmythupnp/eventing.h to
return T(QString::null);
and let us know if that solves it, please. Thanks.
comment:6 Changed 14 years ago by
Hmmm.... not quite....
ccache g++ -c -pipe -fomit-frame-pointer -O3 -g -Wall -Wno-switch -Wpointer-arith -Wredundant-decls -Wno-non-virtual-dtor -funit-at-a-time -D__STDC_CONSTANT_MACROS -D_REENTRANT -DPIC -fPIC -DMMX -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DQT_NO_DEBUG -DQT_SQL_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtSql -I/usr/include/qt4 -I/usr/include -I/usr -I../libmythdb -I.. -I. -o upnpcds.o upnpcds.cpp In file included from upnpcds.h:33, from upnpcds.cpp:28: eventing.h: In member function ‘T StateVariables::GetValue(const QString&)’: eventing.h:236: error: expected primary-expression before ‘(’ token eventing.h:236: error: expected primary-expression before ‘)’ token eventing.h:244: error: expected primary-expression before ‘(’ token eventing.h:244: error: expected primary-expression before ‘)’ token make: *** [upnpcds.o] Error 1
Changed 14 years ago by
Attachment: | mythtv-compile_fixes_for_qt_4_7.patch added |
---|
Changed 14 years ago by
Attachment: | mythplugins-compile_fixes_for_qt_4_7.patch added |
---|
comment:7 Changed 14 years ago by
Status: | infoneeded_new → new |
---|
The attached 2 patches allow compilation with Qt 4.7, but I don't know if they break MythTV or the code involved. The template code (in eventing.h and mythdeque.h) and the change to the TuningRequest? constructor (required after the change to mythdeque.h), especially. The template classes need to be able to work with QString and int, but Qt 4.7 no longer allows construction of a null QString with QString(0) or QString(null). Instead, QString() should be used. I have no idea what effect the template changes will have when T = int.
comment:8 Changed 14 years ago by
Just an update that I've been running this now for 5 weeks without issue,and I'm currently updated to 25612.
comment:9 Changed 14 years ago by
Component: | MythTV - UPnP → MythTV - General |
---|---|
Owner: | changed from dblain to sphery |
Priority: | major → minor |
Status: | new → assigned |
Summary: | trunk and 0.23-fixes build failure in upnpcmgr with Qt 4.7.0-beta1 → Fix MythTV for Qt 4.7 compatibility |
I plan to do a proper fix for this, but likely won't work on it until after we freeze for 0.24.
Changed 14 years ago by
Attachment: | mythtv-trunk-r26286-compile.patch added |
---|
Same patch as above, but modified to work against mythtv trunk
comment:10 Changed 14 years ago by
Changed 14 years ago by
Attachment: | mythtv-8572-compile_fixes_for_qt_4_7-templates.patch added |
---|
Hack to just make MythTV compile. This marks the 2 locations that still need fixing in trunk and -fixes after [26391] (and includes a third change that's only necessary because of the hack that's being used elsewhere).
comment:11 Changed 14 years ago by
comment:14 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:15 Changed 14 years ago by
Milestone: | unknown → 0.23-fixes |
---|
Sorry, hopefully this is formatted better: