Opened 15 years ago

Last modified 15 years ago

#8572 closed defect

trunk and 0.23-fixes build failure in upnpcmgr with Qt 4.7.0-beta1 — at Version 3

Reported by: databubble Owned by: dblain
Priority: minor Milestone: 0.23-fixes
Component: MythTV - General Version: Master Head
Severity: medium Keywords: trunk
Cc: Ticket locked: no

Description (last modified by sphery)

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).

Change History (3)

comment:1 by databubble, 15 years ago

Sorry, hopefully this is formatted better:

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

comment:2 by databubble, 15 years ago

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:3 by sphery, 15 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.