Bug 261488 - kdegames: kgamerenderer.h has wrong number of template arguments (1, should be 2)
Summary: kdegames: kgamerenderer.h has wrong number of template arguments (1, should b...
Status: RESOLVED FIXED
Alias: None
Product: libkdegames
Classification: Frameworks and Libraries
Component: kgamerenderer (show other bugs)
Version: unspecified
Platform: Compiled Sources macOS
: NOR normal
Target Milestone: ---
Assignee: Stefan Majewsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-28 21:26 UTC by Jeremy Lavergne
Modified: 2011-07-30 12:38 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Lavergne 2010-12-28 21:26:44 UTC
Version:           unspecified (using KDE 4.5.90) 
OS:                OS X

In file included from /opt/local/var/macports/build/_Users_aeetes_kde_kdegames4/work/kdegames-4.5.90/libkdegames/kgamerenderedobjectitem.cpp:20:
/opt/local/var/macports/build/_Users_aeetes_kde_kdegames4/work/kdegames-4.5.90/libkdegames/kgamerenderer.h:211: error: expected ',' or '...' before '>' token
/opt/local/var/macports/build/_Users_aeetes_kde_kdegames4/work/kdegames-4.5.90/libkdegames/kgamerenderer.h:211: error: wrong number of template arguments (1, should be 2)
/opt/local/include/QtCore/qdatastream.h:66: error: provided for 'template<class Key, class T> class QHash'
/opt/local/var/macports/build/_Users_aeetes_kde_kdegames4/work/kdegames-4.5.90/libkdegames/kgamerenderer.h:211: error: default argument missing for parameter 5 of 'QPixmap KGameRenderer::spritePixmap(const QString&, const QSize&, int, const QHash<QColor, QColor>&, QColor) const'


The relevant line:

        QPixmap spritePixmap(const QString& key, const QSize& size, int frame = -1, const QHash<QColor, QColor>& customColors = QHash<QColor, QColor>()) const;


Reproducible: Always

Steps to Reproduce:
Build in MacPorts

Actual Results:  
Build fails

Expected Results:  
Build succeeds

QT is qt4-mac @4.7.1
Comment 1 Stefan Majewsky 2010-12-29 17:15:08 UTC
Looks like it's only missing the <QtGui/QColor> include. Could you check this?
Comment 2 Jeremy Lavergne 2010-12-29 17:30:02 UTC
Adding #include <QtGui/QColor> to kgamerenderedobjectitem.cpp/.h and kgamerenderer.h had no effect.

Did you mean another file?
Comment 3 Stefan Majewsky 2011-01-04 22:54:18 UTC
I can just guess because I'm on Linux. Perhaps <QtCore/QHash> is not included for some reason? If that's not it, then I doubt that I can help.
Comment 4 Jeremy Lavergne 2011-01-30 01:34:20 UTC
This continues to be an issue in the 4.6.0 release.
Comment 5 Stefan Majewsky 2011-01-31 22:49:37 UTC
Eh, could you try to typedef QHash<QColor, QColor> to something without comma? Looking at the exact error message, it might be that the compiler misreads the comma in the default argument as a comma in the argument list. If so, I add the typedef upstream (although you should still file a bug against the compiler).
Comment 6 Jeremy Lavergne 2011-02-02 14:33:48 UTC
Haven't tried your suggestion yet; Here is an update from what else I've tried.

Switching from gcc4.2 to gcc4.0 let building continue to a visibility issue in ksudoku. There definitely appears to be an issue in the code with respect to Apple's gcc4.2 (default on OS >10.6). gcc4.0 is the default for OS 10.4 and 10.5. I can tell MacPorts to always use gcc4.0 for the project.

That leaves this bug needing fixed for now (or I can simply skip building ksudoku):


/opt/local/var/macports/build/_Users_aeetes_dports_kde_kdegames4/work/kdegames-4.5.5/ksudoku/engine/constrainthelperstorage.cpp: In member function 'void ConstraintHelperStorage::Entry::setup(Ruleset*)':
/opt/local/var/macports/build/_Users_aeetes_dports_kde_kdegames4/work/kdegames-4.5.5/ksudoku/engine/constrainthelperstorage.cpp:31: error: 'QVector<ConstraintHelper*> ConstraintHelperStoragePrivate::helpers' is private
/opt/local/var/macports/build/_Users_aeetes_dports_kde_kdegames4/work/kdegames-4.5.5/ksudoku/engine/constrainthelperstorage.cpp:102: error: within this context
/opt/local/var/macports/build/_Users_aeetes_dports_kde_kdegames4/work/kdegames-4.5.5/ksudoku/engine/constrainthelperstorage.cpp:31: error: 'QVector<ConstraintHelper*> ConstraintHelperStoragePrivate::helpers' is private
/opt/local/var/macports/build/_Users_aeetes_dports_kde_kdegames4/work/kdegames-4.5.5/ksudoku/engine/constrainthelperstorage.cpp:103: error: within this context
make[2]: *** [ksudoku/engine/CMakeFiles/logine.dir/constrainthelperstorage.o] Error 1
Comment 7 Jeremy Lavergne 2011-02-02 16:25:40 UTC
My apologies on the latest post, it got built with 4.5.5 again.
Comment 8 Nick W 2011-02-05 03:58:36 UTC
I'm building this on Gentoo from the kde overlay and encountered this. It does seem to be GCC related as using gcc-config to set my native compiler to GCC 4.4.4 from 4.3.4 fixed the issue.
Comment 9 Mark Davies 2011-05-02 13:23:12 UTC
Also strike this on NetBSD (gcc is 4.1)

The work around (thanks to Adam Ciarciński for finding it) is to put "QHash<QColor, QColor>()" statement in extra parentheses, so the definition should look like this:

QPixmap spritePixmap(const QString& key, const QSize& size, int frame = -1, const QHash<QColor, QColor>& customColors = (QHash<QColor, QColor>())) const;
Comment 10 Stefan Majewsky 2011-07-30 12:38:04 UTC
Fixed in trunk by Ian Wadham, revision 1243973.