Bug 177863 (scriptgen45) - amarok 2.0 (scriptengine) fails to build with Qt 4.5 snapshots
Summary: amarok 2.0 (scriptengine) fails to build with Qt 4.5 snapshots
Status: RESOLVED FIXED
Alias: scriptgen45
Product: amarok
Classification: Applications
Component: Tools/Script Manager (show other bugs)
Version: 2.0
Platform: Compiled Sources Linux
: HI normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
: 178965 184482 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-12-15 18:04 UTC by Bernhard Rosenkraenzer
Modified: 2009-12-09 11:28 UTC (History)
32 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Update of Generator (95.83 KB, patch)
2008-12-29 21:44 UTC, Jason A. Donenfeld
Details
amarok svn still fails here (624.33 KB, text/plain)
2009-02-02 16:28 UTC, Dan Coats
Details
inital missing <int> declaration patch (1.50 KB, patch)
2009-02-16 03:18 UTC, Dan Coats
Details
Another build.log. (366.95 KB, application/octet-stream)
2009-02-22 17:46 UTC, Mieszko Ślusarczyk
Details
Patch to have the latest SVN version compiled with Qt 4.5 (1.29 KB, patch)
2009-03-01 13:14 UTC, Eelko Berkenpies
Details
build.log for amarok 2.0.2 + first patch (453.71 KB, application/octet-stream)
2009-03-09 12:43 UTC, Mieszko Ślusarczyk
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bernhard Rosenkraenzer 2008-12-15 18:04:11 UTC
Version:           2.0 (using Devel)
Compiler:          gcc 4.3.2 
OS:                Linux
Installed from:    Compiled sources

Building amarok 2.0 with a current Qt 4.5 snapshot results in:

Linking CXX shared module ../../../../lib/libqtscript_gui.so                    
CMakeFiles/qtscript_gui.dir/generated_cpp/com_trolltech_qt_gui/qtscript_QColorDialog.o: In function `.L135':                                                    
qtscript_QColorDialog.cpp:(.text+0xddf): undefined reference to `QtScriptShell_QColorDialog::QtScriptShell_QColorDialog(QColor const&, QWidget*)'               
CMakeFiles/qtscript_gui.dir/generated_cpp/com_trolltech_qt_gui/qtscript_QColorDialog.o: In function `.L137':                                                    
qtscript_QColorDialog.cpp:(.text+0x10d1): undefined reference to `QtScriptShell_QColorDialog::QtScriptShell_QColorDialog(QWidget*)'                             
qtscript_QColorDialog.cpp:(.text+0x12d3): undefined reference to `QtScriptShell_QColorDialog::QtScriptShell_QColorDialog(QWidget*)'                             
qtscript_QColorDialog.cpp:(.text+0x13ec): undefined reference to `QtScriptShell_QColorDialog::QtScriptShell_QColorDialog(QColor const&, QWidget*)'
CMakeFiles/qtscript_gui.dir/generated_cpp/com_trolltech_qt_gui/qtscript_QFontDialog.o: In function `qtscript_QFontDialog_static_call(QScriptContext*, QScriptEngine*)':
qtscript_QFontDialog.cpp:(.text+0x12a1): undefined reference to `QtScriptShell_QFontDialog::QtScriptShell_QFontDialog(QWidget*)'
qtscript_QFontDialog.cpp:(.text+0x1515): undefined reference to `QtScriptShell_QFontDialog::QtScriptShell_QFontDialog(QFont const&, QWidget*)'
qtscript_QFontDialog.cpp:(.text+0x191b): undefined reference to `QtScriptShell_QFontDialog::QtScriptShell_QFontDialog(QWidget*)'
qtscript_QFontDialog.cpp:(.text+0x1ae3): undefined reference to `QtScriptShell_QFontDialog::QtScriptShell_QFontDialog(QFont const&, QWidget*)'
CMakeFiles/qtscript_gui.dir/generated_cpp/com_trolltech_qt_gui/qtscript_QInputDialog.o: In function `.L234':
qtscript_QInputDialog.cpp:(.text+0xe8e): undefined reference to `QtScriptShell_QInputDialog::QtScriptShell_QInputDialog(QWidget*, QFlags<Qt::WindowType>)'
CMakeFiles/qtscript_gui.dir/generated_cpp/com_trolltech_qt_gui/qtscript_QInputDialog.o: In function `.L236':
qtscript_QInputDialog.cpp:(.text+0x19cf): undefined reference to `QtScriptShell_QInputDialog::QtScriptShell_QInputDialog(QWidget*, QFlags<Qt::WindowType>)'
qtscript_QInputDialog.cpp:(.text+0x259a): undefined reference to `QtScriptShell_QInputDialog::QtScriptShell_QInputDialog(QWidget*, QFlags<Qt::WindowType>)'
collect2: ld returned 1 exit status
make[2]: *** [lib/libqtscript_gui.so] Error 1
make[1]: *** [src/scriptengine/generator/generator/CMakeFiles/qtscript_gui.dir/all] Error 2
Comment 1 Mark Kretschmann 2008-12-15 18:12:02 UTC
Yes, we have heard the same from Thiago too. I guess we need to upgrade the generator.
Comment 2 Mark Kretschmann 2008-12-19 07:32:43 UTC
Ok, since the beta of Qt 4.5 has just been released, we need to solve this ASAP.
Comment 3 Leo Franchi 2008-12-23 01:05:43 UTC
i'll take a look. just got kdelibs+co compiled against qt4.5, and amarok just failed.
Comment 4 Mark Kretschmann 2008-12-28 14:02:57 UTC
*** Bug 178965 has been marked as a duplicate of this bug. ***
Comment 5 Jason A. Donenfeld 2008-12-29 21:44:13 UTC
Created attachment 29742 [details]
Update of Generator

In the attached patch, I updated our qtscript generator to the latest git from git://labs.trolltech.com/qtscriptgenerator and updated partially the cmake lists to account for the new changes, but the same compile error still exists. Is this an upstream problem?
Comment 6 Ian Monroe 2008-12-30 01:37:05 UTC
We've been talking on IRC, but I just want to make sure we're all on the same page.

The compile errors are almost certainly due to problems in our CMake. Linker errors stink of cmake problems, and I can't imagine Kent (upstream) releasing something that doesn't compile so blatantly. 

The new script generator does work with Qt 4.4 (using the default qmake stuff) so that's a big relief to me. We should go ahead of with updating. Let me know if you need help Jason. 
Comment 7 Jason A. Donenfeld 2008-12-30 02:58:15 UTC
I solved the linker issues in the above patch. It results in a compiler error. 
Comment 8 Jason A. Donenfeld 2008-12-30 03:00:43 UTC
/usr/include/qt4/QtCore/qmetatype.h: In static member function 'static int QMetaTypeId2<T>::qt_metatype_id() [with T = QList<int>]':
/usr/include/qt4/QtCore/qmetatype.h:194:   instantiated from 'int qMetaTypeId(T*) [with T = QList<int>]'
/usr/include/qt4/QtScript/qscriptengine.h:367:   instantiated from 'T qscriptvalue_cast(const QScriptValue&, T*) [with T = QList<int>]'
/home/zx2c4/Projects/amarok/src/scriptengine/generator/generator/generated_cpp/com_trolltech_qt_gui/qtscriptshell_QTextCodecPlugin.cpp:128:   instantiated from here
/usr/include/qt4/QtCore/qmetatype.h:184: error: 'qt_metatype_id' is not a member of 'QMetaTypeId<QList<int> >'
make[2]: *** [src/scriptengine/generator/generator/CMakeFiles/qtscript_gui.dir/generated_cpp/com_trolltech_qt_gui/qtscriptshell_QTextCodecPlugin.o] Error 1
make[1]: *** [src/scriptengine/generator/generator/CMakeFiles/qtscript_gui.dir/all] Error 2
make: *** [all] Error 2

is the error I receive, not the one above.

I received this error before updating the tree's qtscriptgenerator. When I updated it, I got the linker error, so I updated the cmake files as well, which solved the linker errors. But I'm still left with the same compile error. 

This is qt 4.5 beta1.
Comment 9 Mark Kretschmann 2009-01-03 10:57:27 UTC
Any progress on this? Would be great to fix it before 2.0.1 tagging.
Comment 10 Ian Monroe 2009-01-04 21:44:38 UTC
SVN commit 905679 by ianmonroe:

This is commiting the latest Qt Script Generator. This should fix things for
Qt 4.5, at least it does for me. I'm using a recent snaptshot, I didn't have
the problems reported by Jason and Leo.

I'm worried it might break compliation on Qt 4.4. Markey has promised to test
post-commit.

Jason Donenfeld gets credit for most of the cmake changes.

BUG: 177863

 M  +19 -17    generator/abstractmetabuilder.cpp  
 M  +14 -14    generator/asttoxml.cpp  
 M  +10 -3     generator/classgenerator.cpp  
 M  +2 -0      generator/main.cpp  
 M  +12 -1     generator/main.h  
 M  +1 -1      generator/parser/codemodel.cpp  
 M  +16 -0     generator/parser/rpp/pp-engine-bits.h  
 M  +12 -1     generator/qtscript_core.cmake  
 M  +15 -9     generator/qtscript_gui.cmake  
 M  +9 -0      generator/qtscript_network.cmake  
 M  +1 -1      generator/reporthandler.cpp  
 M  +10 -2     generator/shellimplgenerator.cpp  
 M  +9 -6      generator/typesystem.cpp  
 M  +24 -16    generator/typesystem_core-common.xml  
 M  +35 -6     generator/typesystem_core-qtscript.xml  
 M  +38 -19    generator/typesystem_core.xml  
 M  +25 -36    generator/typesystem_gui-common.xml  
 M  +4 -3      generator/typesystem_gui-qtscript.xml  
 M  +27 -37    generator/typesystem_gui.xml  
 M  +19 -0     generator/typesystem_network-common.xml  
 M  +3 -3      generator/typesystem_network-qtscript.xml  
 M  +22 -1     generator/typesystem_network.xml  
 M  +5 -0      generator/typesystem_phonon-qtscript.xml  
 M  +1 -1      generator/typesystem_phonon.xml  
 M  +2 -0      generator/typesystem_webkit-common.xml  
 M  +2 -0      generator/typesystem_webkit-qtscript.xml  
 M  +3 -1      generator/typesystem_webkit.xml  
 M  +2 -2      generator/typesystem_xml-common.xml  
 M  +2 -2      generator/typesystem_xml.xml  
 M  +1 -0      generator/typesystem_xmlpatterns-common.xml  
 M  +3 -0      generator/typesystem_xmlpatterns-qtscript.xml  
 M  +2 -1      generator/typesystem_xmlpatterns.xml  
 M  +10 -1     qtbindings/qs_eval/main.cpp  
 M  +2 -0      qtbindings/qs_eval/qs_eval.pro  


WebSVN link: http://websvn.kde.org/?view=rev&revision=905679
Comment 11 Mark Kretschmann 2009-01-05 08:50:54 UTC
SVN commit 905810 by markey:

Revert "wasn't able to figure out how to get something to conditionally"
Revert "This is commiting the latest Qt Script Generator. This should fix things for"

Sorry, trunk still doesn't build with Qt 4.4, so I'm reverting both of
Ian's commits for now.
Comment 12 Ian Monroe 2009-01-05 20:27:10 UTC
SVN commit 906213 by ianmonroe:

Fix building for Qt 4.5. Thanks to Alex Merry for pointing out QTVERSION.
BUG: 177863

 M  +3 -3      ChangeLog  
 M  +1 -1      src/scriptengine/generator/generator/qtscript_core.cmake  
 M  +4 -0      src/scriptengine/generator/generator/qtscript_gui.cmake  
 M  +5 -6      src/scriptengine/generator/generator/qtscript_network.cmake  


WebSVN link: http://websvn.kde.org/?view=rev&revision=906213
Comment 13 Fredrik Karlsson 2009-01-09 20:30:06 UTC
I still see the compiler error reported by Jason A. Donenfeld with Qt 4.5 snapshot from 20090108 and a clean checkout of Amarok.
Comment 14 FiNeX 2009-01-09 21:04:09 UTC
@Fredrik: did you remove the build dir too?
Comment 15 Fredrik Karlsson 2009-01-09 23:02:34 UTC
(In reply to comment #14)
> @Fredrik: did you remove the build dir too?
> 

yes
Comment 16 Dan Coats 2009-01-19 17:22:54 UTC
Build latest qt as of this morning from git://labs.trolltech.com/qt/all
and clean amarok build dir results in same thing still.

[ 90%] Building CXX object src/scriptengine/generator/generator/CMakeFiles/qtscript_gui.dir/generated_cpp/com_trolltech_qt_gui/qtscriptshell_QTextCodecPlugin.o                                                                                                                         
/usr/include/qt4/QtCore/qmetatype.h: In static member function ‘static int QMetaTypeId2<T>::qt_metatype_id() [with T = QList<int>]’:        
/usr/include/qt4/QtCore/qmetatype.h:194:   instantiated from ‘int qMetaTypeId(T*) [with T = QList<int>]’                                    
/usr/include/qt4/QtScript/qscriptengine.h:367:   instantiated from ‘T qscriptvalue_cast(const QScriptValue&) [with T = QList<int>]’         
/var/tmp/portage/media-sound/amarok-9999/work/amarok_build/src/scriptengine/generator/generator/generated_cpp/com_trolltech_qt_gui/qtscriptshell_QTextCodecPlugin.cpp:128:   instantiated from here                                                                                     
/usr/include/qt4/QtCore/qmetatype.h:184: error: ‘qt_metatype_id’ is not a member of ‘QMetaTypeId<QList<int> >’                              
make[2]: *** [src/scriptengine/generator/generator/CMakeFiles/qtscript_gui.dir/generated_cpp/com_trolltech_qt_gui/qtscriptshell_QTextCodecPlugin.o] Error 1                                                                                                                             
make[1]: *** [src/scriptengine/generator/generator/CMakeFiles/qtscript_gui.dir/all] Error 2                                                 
make[1]: *** Waiting for unfinished jobs....                                                                                                
[ 90%] Building CXX object src/context/applets/albums/CMakeFiles/amarok_context_applet_albums.dir/TrackItem.o                               
[ 90%] Building CXX object src/context/applets/albums/CMakeFiles/amarok_context_applet_albums.dir/AlbumItem.o                               
[ 90%] Building CXX object src/context/applets/albums/CMakeFiles/amarok_context_applet_albums.dir/AlbumsModel.o                             
Linking CXX shared module ../../../../lib/amarok_context_applet_albums.so                                                                   
[ 90%] Built target amarok_context_applet_albums                                                                                            
/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/../../../../i686-pc-linux-gnu/bin/ld: warning: creating a DT_TEXTREL in object.                        
[ 90%] Built target amarok_collection-sqlcollection                                                                                         
make: *** [all] Error 2 
Comment 17 Leo Franchi 2009-01-26 03:39:39 UTC
same here, re-opening.
Comment 18 Laurens Vanhove 2009-01-26 15:53:43 UTC
Current svn amarok still gives the same error with qt4.5beta1 on my system (gcc 4.1.2, kde svn trunk)
Comment 19 Bernhard Rosenkraenzer 2009-01-26 15:58:01 UTC
Works for me (with Qt 4.5.0 snapshot 20090121)...

Is everyone with problems still using an ancient Qt 4.5.0 snapshot or beta1?
Comment 20 Leo Franchi 2009-01-26 16:01:40 UTC
i used a snapshot from yesterday, cleaned everything, same error.
Comment 21 Dan Coats 2009-01-26 16:33:23 UTC
It wasnt building with beta1, I was told "thats to old" so have been building latest git from git://labs.trolltech.com/qt/all last complete build 20090121 amarok still fails
Comment 22 Dan Meltzer 2009-01-26 17:29:54 UTC
We really need to package the scriptengine separately from amarok... so this doesn't happen.  It would be nice to post releases on the google code page and depend on them.  Any chance of this happening Ian/Peter?
Comment 23 eric 2009-02-02 09:03:14 UTC
Same problem here with the qt-4.5-20090126 and amarok2-20090202. A week ago I've successfully build amarok2-20090128 with the same qt-snapshot.
Comment 24 eric 2009-02-02 09:50:21 UTC
Sorry for my previous post. Because I've had this problem in the past, I was too soon to think that this problem is back.
After turning off KDE_ENABLE_FINAL todays amarok2 (svn-920003) build successfully with a qt-4.5 snapshot of 20090126.
Comment 25 Mark Kretschmann 2009-02-02 10:48:34 UTC
Thanks Eric. So I'm closing the report as fixed, as it seems to work now for everyone, if I understood correctly.
Comment 26 Dan Coats 2009-02-02 16:28:19 UTC
Created attachment 30870 [details]
amarok svn still fails here

Still can not build amarok svn as of today, with qt-4.5 20090130
Comment 27 Clas Rurik 2009-02-02 19:37:52 UTC
same here. still fails to build (revision 920304).
Comment 28 Mark Kretschmann 2009-02-02 22:58:52 UTC
So I'm really not sure what to make of this. Anyone able to shed some light on it? Eean?
Comment 29 Leo Franchi 2009-02-03 14:08:48 UTC
still getting the same error. i'm reopening as it still doesn't work for 3 of us.
Comment 30 Ian Monroe 2009-02-04 05:37:25 UTC
Well it works for me and I use a recent Qt snapshot.

Could someone with the error please compile using the qmake method directly out of git://labs.trolltech.com/qtscriptgenerator

Hopefully you can reproduce using the upstream package. :) If so open a bug upstream at http://code.google.com/p/qtscriptgenerator/issues/list and post the link to it here.
Comment 31 Clas Rurik 2009-02-04 17:26:21 UTC
(In reply to comment #30)
> Well it works for me and I use a recent Qt snapshot.
> 
> Could someone with the error please compile using the qmake method directly out
> of git://labs.trolltech.com/qtscriptgenerator
> 
> Hopefully you can reproduce using the upstream package. :) If so open a bug
> upstream at http://code.google.com/p/qtscriptgenerator/issues/list and post the
> link to it here.
> 

qtscriptgenerator compiles fine here.

updated qt some hours ago and tried again with a clean checkout but amarok still fails to build.
Comment 32 Ian Monroe 2009-02-04 18:57:54 UTC
@Clas just to be clear, you followed the whole readme? You have to build the generator, generate the files and then build the actual bindings.

Anyways something is probably wrong with our cmake files.

Do people with this error have more then one copy of Qt installed? Maybe the wrong Qt location is being passed. The only other thing it might be is some sort of definition mising.
Comment 33 Dan Coats 2009-02-04 19:41:56 UTC
Please excuse me IF im just plain wrong but ... let me try..
from what I have learned
You have to have a Q_DECLARE_METATYPE(QList<whatever>) somewhere before you 
can put QList<whatever> inside a QVariant and take it out.

and what I see is 
# grep Q_DECLARE_METATYPE qtscriptshell_QTextCodecPlugin.cpp
Q_DECLARE_METATYPE(QList<QByteArray>)
Q_DECLARE_METATYPE(QChildEvent*)
Q_DECLARE_METATYPE(QTextCodec*)
Q_DECLARE_METATYPE(QEvent*)
Q_DECLARE_METATYPE(QTimerEvent*)

# grep QList qtscriptshell_QTextCodecPlugin.cpp
Q_DECLARE_METATYPE(QList<QByteArray>)
QList<QByteArray >  QtScriptShell_QTextCodecPlugin::aliases() const
        return qscriptvalue_cast<QList<QByteArray > >(_q_function.call(__qtscript_self));
QList<int >  QtScriptShell_QTextCodecPlugin::mibEnums() const
        return qscriptvalue_cast<QList<int > >(_q_function.call(__qtscript_self));
QList<QByteArray >  QtScriptShell_QTextCodecPlugin::names() const
        return qscriptvalue_cast<QList<QByteArray > >(_q_function.call(__qtscript_self));


in the above I see a Q_DECLARE_METATYPE(QList<QByteArray>
but i see no Q_DECLARE_METATYPE(QList<int >)

which specifically is the error message.
Comment 34 Clas Rurik 2009-02-04 22:58:38 UTC
(In reply to comment #32)
> @Clas just to be clear, you followed the whole readme? You have to build the
> generator, generate the files and then build the actual bindings.
> 
> Anyways something is probably wrong with our cmake files.
> 
> Do people with this error have more then one copy of Qt installed? Maybe the
> wrong Qt location is being passed. The only other thing it might be is some
> sort of definition mising.
> 

wups sry, was a bit in a hurry and just compiled the generator. indeed there is an error but it's a different one.

../../generated_cpp/com_trolltech_qt_core/qtscriptshell_QFutureIterator.cpp: In constructor 'QtScriptShell_QFutureIterator::QtScriptShell_QFutureIterator()':
../../generated_cpp/com_trolltech_qt_core/qtscriptshell_QFutureIterator.cpp:10: error: no matching function for call to 'QFutureIterator<QScriptValue>::QFutureIterator()'
/usr/include/qt4/QtCore/qfuture.h:186: note: candidates are: QFutureIterator<T>::QFutureIterator(const QFuture<T>&) [with T = QScriptValue]
/usr/include/qt4/QtCore/qfuture.h:186: note:                 QFutureIterator<QScriptValue>::QFutureIterator(const QFutureIterator<QScriptValue>&)
make[2]: *** [release/qtscriptshell_QFutureIterator.o] Error 1
make[1]: *** [release] Error 2
make: *** [sub-qtscript_core-make_default] Error 2

I don't know much about qtscriptgenerator so hopefully I did not miss something (again) :-) just "stupidly" followed the readme until step 3.

btw. I only have one Qt4 installation
Comment 35 Marcel Partap 2009-02-07 02:12:14 UTC
Dan you're totally right, adding that declaration fixes compilation. Now which file is that code generated from anyways?
Comment 36 Ian Monroe 2009-02-14 17:29:51 UTC
@Clas thats totally the error you get if you haven't generated any files. :D Please follow the directions in the README in order.

@Coats this is computer generated code so that doesn't really help.
Comment 37 pbts 2009-02-15 03:10:17 UTC
same problem for me; amarok2 from SVN and qt 4.5.0-rc1

/usr/include/QtCore/qmetatype.h:184: error: 'qt_metatype_id' is not a member of 'QMetaTypeId<QList<int> >'

Hope you guys can fix this soon!
Comment 38 Clas Rurik 2009-02-15 16:42:58 UTC
@Ian maybe you can see what i am missing :-/

spectred@pc-spectred ~/tmp $ git clone git://labs.trolltech.com/qtscriptgenerator
...
  ** 1) Build the generator **
spectred@pc-spectred ~/tmp $ cd qtscriptgenerator/generator/
spectred@pc-spectred ~/tmp/qtscriptgenerator/generator $ qmake && make
...
  ** 2) Run the generator (without arguments) **
spectred@pc-spectred ~/tmp/qtscriptgenerator/generator $ ./generator
Please wait while source files are being generated...
Classes in typesystem: 7
Generated:
  - classes...: 7 (7)
  - header....: 7 (7)
  - impl......: 7 (7)
  - modules...: 1 (1)
  - pri.......: 1 (1)

Done, 0 warnings (1126 known issues)
  ** 3) Build the bindings plugins **
spectred@pc-spectred ~/tmp/qtscriptgenerator/generator $ cd ../qtbindings/
spectred@pc-spectred ~/tmp/qtscriptgenerator/qtbindings $ qmake && make
[error as above]
Comment 39 Ian Monroe 2009-02-15 17:12:07 UTC
do an export QTDIR=/usr/or/whatever/your/qt/prefix is, before running the generator.

There are more then 7 classes to generate :)
Comment 40 pbts 2009-02-15 20:37:59 UTC
(In reply to comment #39)
> do an export QTDIR=/usr/or/whatever/your/qt/prefix is, before running the
> generator.
> 
> There are more then 7 classes to generate :)
> 

the binaries are in /usr/bin/qt4 and the libs in /usr/lib/qt4. QTDIR=/usr and I still get the same error. Any other things I could try? Thanks!
Comment 41 Clas Rurik 2009-02-15 21:24:46 UTC
wasn't able to make QTDIR work in order to get more classes generated. but using

generator --include-paths=/usr/include/qt4

i get

Classes in typesystem: 522
Generated:
  - classes...: 503 (503)
  - header....: 339 (339)
  - impl......: 339 (339)
  - modules...: 10 (10)
  - pri.......: 10 (10)

with this the first error is

cd qtscript_phonon/ && /usr/bin/qmake qtscript_phonon.pro -unix -o Makefile
WARNING: Failure to find: ../../generated_cpp/com_trolltech_qt_phonon/main.cpp
WARNING: Failure to find: ../../generated_cpp/com_trolltech_qt_phonon/main.cpp
cd qtscript_phonon/ && make -f Makefile
make[1]: Entering directory `/home/spectred/tmp/qtscriptgenerator/qtbindings/qtscript_phonon'
make -f Makefile.Release
make[2]: Entering directory `/home/spectred/tmp/qtscriptgenerator/qtbindings/qtscript_phonon'
make[2]: *** No rule to make target `../../generated_cpp/com_trolltech_qt_phonon/main.cpp', needed by `release/main.o'.  Stop.
make[2]: Leaving directory `/home/spectred/tmp/qtscriptgenerator/qtbindings/qtscript_phonon'
make[1]: *** [release] Error 2
make[1]: Leaving directory `/home/spectred/tmp/qtscriptgenerator/qtbindings/qtscript_phonon'
make: *** [sub-qtscript_phonon-make_default] Error 2

this may not be a problem with qtscriptgenerator as I have installed media-sound/phonon (from kde repos) instead of x11-libs/phonon. Guess I have to expand the include paths a bit. Will try this if getting so far is not enough.
But iirc qt_gui bindings where generated before all this so if I guess correctly there was no such problem like before when building amarok.
Comment 42 Andre Woebbeking 2009-02-15 22:54:20 UTC
git://labs.trolltech.com/qtscriptgenerator with qmake works for me but not amarok from SVN. The only difference in generated_cpp/com_trolltech_qt_gui/qtscriptshell_QTextCodecPlugin.cpp is that the in amarok build Q_DECLARE_METATYPE(QList<int>) is missing.
Comment 43 Leo Franchi 2009-02-16 01:56:24 UTC
*** Bug 184482 has been marked as a duplicate of this bug. ***
Comment 44 Dan Coats 2009-02-16 02:38:13 UTC
@Ian yeah obviously,
I as well as others are able to work around this by starting the build, waiting until approx 12% or so when the scriptgenerator runs then editing qtscriptshell_QTextCodecPlugin.cpp  adding Q_DECLARE_METATYPE(QList<int>) and build completes, also obviously its not easy to patch during that phase, so,where is it generated from or generated incorrectly from in some situations, why would the generator fail to provide a single declaration in a single file on only "some" builds, when it needs it.
Comment 45 Leo Franchi 2009-02-16 02:42:11 UTC
so this patch (not mine, from andras mantia): http://pastebin.ca/1337386

seems to fix the QList<int> metatype problem. however... it breaks the build for those on qt4.4 and those for who it already worked with qt4.5 (complains about QList<int> declared twice, who would have thought).

so give it a shot, and if it works for you, do report back.

however, this is not an acceptable patch.  but maybe we can get closer to a working solution.
Comment 46 Dan Coats 2009-02-16 03:18:33 UTC
Created attachment 31358 [details]
inital missing <int> declaration patch

patch mentioned above since pastebins are not ideal for bug historical value
Comment 47 Mieszko Ślusarczyk 2009-02-16 12:15:14 UTC
Works for me on gentoo (compiling amarok 2.0.1.1 against qt 4.5.0_rc1)
Comment 48 Clas Rurik 2009-02-16 15:00:53 UTC
works here: gentoo, amarok svn and qt live build (maybe some weeks old).
Comment 49 Ian Monroe 2009-02-16 20:21:47 UTC
Upstream has put in a fix recently regarding QTextCodec. I've applied it to my local Amarok and will commit when its done compiling.
Comment 50 Ian Monroe 2009-02-16 22:04:08 UTC
SVN commit 927123 by ianmonroe:

update to latest upstream script generator
I think this will fix the issues some people are having building it.
Just reopen the bug if I'm wrong.
BUG: 177863

 M  +2 -0      qtscript_core.cmake  
 M  +0 -1      qtscript_gui.cmake  
 M  +3 -0      typesystem_core-common.xml  
 M  +1 -0      typesystem_core-qtscript.xml  
 M  +4 -1      typesystem_core.xml  
 M  +0 -2      typesystem_gui-common.xml  
 M  +0 -1      typesystem_gui-qtscript.xml  
 M  +1 -3      typesystem_gui.xml  


WebSVN link: http://websvn.kde.org/?view=rev&revision=927123
Comment 51 Clas Rurik 2009-02-17 00:59:11 UTC
now I get

[ 78%] make[2]: *** No rule to make target `src/scriptengine/generator/generator/generated_cpp/com_trolltech_qt_gui/qtscriptshell_QTextCodecPlugin.cpp', needed by `src/scriptengine/generator/generator/CMakeFiles/qtscript_gui.dir/generated_cpp/com_trolltech_qt_gui/qtscriptshell_QTextCodecPlugin.o'.  Stop.
make[2]: *** Waiting for unfinished jobs....
...
make[1]: *** [src/scriptengine/generator/generator/CMakeFiles/qtscript_gui.dir/all] Error 2
make: *** [all] Error 2

someone with the same problem?
Comment 52 Dan Coats 2009-02-17 14:58:11 UTC
same thing here.
Comment 53 Ian Monroe 2009-02-17 16:28:56 UTC
Ah ok, I'm guessing there's a bug I introduced for people not using a clean build. 

I'm rebuilding now.
Comment 54 Ian Monroe 2009-02-18 00:01:10 UTC
Ok actually I think you two just didn't run the generator again after the XML changed. Delete the generator to relink and regenerate or just do a completely clean build.
Comment 55 Paulo Dias 2009-02-18 00:22:34 UTC
still breaking with svn tag 927628, kde 4.2 and qt 4.4.3 (kubuntu)


[ 48%] Building CXX object src/scriptengine/generator/generator/CMakeFiles/qtscript_gui.dir/generated_cpp/com_trolltech_qt_gui/qtscriptshell_QTextCharFormat.o
cd /usbdisk/groo_home/deb_builds/amarok/amarok-kde4/obj-i486-linux-gnu/src/scriptengine/generator/generator && /usr/bin/g++   -D_BSD_SOURCE -DQT_OPENGL_LIB -DQT_SCRIPT_LIB -DQT_SVG_LIB -DQT_UITOOLS_LIB -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_TEST_LIB -DQT_DBUS_LIB -DQT_XML_LIB -DQT_SQL_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DRXX_ALLOCATOR_INIT_0 -DQT_WEBKIT -Dqtscript_gui_EXPORTS -g -O2 -g -Wall -O2 -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -fno-check-new -fno-common -Woverloaded-virtual -fno-threadsafe-statics -fvisibility=hidden -fvisibility-inlines-hidden -DNDEBUG -DQT_NO_DEBUG -fPIC -I/usbdisk/groo_home/deb_builds/amarok/amarok-kde4/obj-i486-linux-gnu/src/scriptengine/generator/generator -I/usbdisk/groo_home/deb_builds/amarok/amarok-kde4/src/scriptengine/generator/generator -I/usbdisk/groo_home/deb_builds/amarok/amarok-kde4/src/scriptengine/generator/generator/parser -I/usbdisk/groo_home/deb_builds/amarok/amarok-kde4/src/scriptengine/generator/generator/parser/rpp -I/usbdisk/groo_home/deb_builds/amarok/amarok-kde4/obj-i486-linux-gnu -I/usbdisk/groo_home/deb_builds/amarok/amarok-kde4/src/scriptengine/generator/generator/../qtbindings/qtscript_core -I/usr/include/qt4 -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtScript -I/usr/include/qt4/QtSvg -I/usr/include/qt4/QtUiTools -I/usr/include/qt4/QtWebKit -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtTest -I/usr/include/qt4/QtDBus -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtSql -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtCore -I/usr/include/qt4/phonon -I/usr/include/qt4/QtXmlPatterns -I/usr/include/qt4/QtHelp -I/usr/include/qt4/QtAssistant -I/usr/include/qt4/QtDesigner -I/usr/include/qt4/Qt3Support -I/usr/include/qt4/Qt -I/usr/share/qt4/mkspecs/default   -o CMakeFiles/qtscript_gui.dir/generated_cpp/com_trolltech_qt_gui/qtscriptshell_QTextCharFormat.o -c /usbdisk/groo_home/deb_builds/amarok/amarok-kde4/obj-i486-linux-gnu/src/scriptengine/generator/generator/generated_cpp/com_trolltech_qt_gui/qtscriptshell_QTextCharFormat.cpp
make[3]: *** No rule to make target `src/scriptengine/generator/generator/generated_cpp/com_trolltech_qt_gui/qtscriptshell_QTextCodecPlugin.cpp', needed by `src/scriptengine/generator/generator/CMakeFiles/qtscript_gui.dir/generated_cpp/com_trolltech_qt_gui/qtscriptshell_QTextCodecPlugin.o'.  Stop.
make[3]: Leaving directory `/usbdisk/groo_home/deb_builds/amarok/amarok-kde4/obj-i486-linux-gnu'
make[2]: *** [src/scriptengine/generator/generator/CMakeFiles/qtscript_gui.dir/all] Error 2
make[2]: Leaving directory `/usbdisk/groo_home/deb_builds/amarok/amarok-kde4/obj-i486-linux-gnu'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usbdisk/groo_home/deb_builds/amarok/amarok-kde4/obj-i486-linux-gnu'
make: *** [debian/stamp-makefile-build] Error 2
dpkg-buildpackage: failure: debian/rules build gave error exit status 2

Can't build since the qtscript engine was updated :(
Comment 56 Dan Coats 2009-02-18 00:45:12 UTC
[ 81%] Building CXX object src/scriptengine/generator/generator/CMakeFiles/qtscript_gui.dir/generated_cpp/com_trolltech_qt_gui/qtscriptshell_QTextBlockGroup.o                                                                                                                          
[ 81%] Building CXX object src/scriptengine/generator/generator/CMakeFiles/qtscript_gui.dir/generated_cpp/com_trolltech_qt_gui/qtscriptshell_QTextBlockUserData.o                                                                                                                       
[ 81%] Building CXX object src/scriptengine/generator/generator/CMakeFiles/qtscript_gui.dir/generated_cpp/com_trolltech_qt_gui/qtscriptshell_QTextBrowser.o                                                                                                                             
[ 81%] make[2]: *** No rule to make target `src/scriptengine/generator/generator/generated_cpp/com_trolltech_qt_gui/qtscriptshell_QTextCodecPlugin.cpp', needed by `src/scriptengine/generator/generator/CMakeFiles/qtscript_gui.dir/generated_cpp/com_trolltech_qt_gui/qtscriptshell_QTextCodecPlugin.o'.  Stop.                                                                                                                   
make[2]: *** Waiting for unfinished jobs....                                                                                                
Building CXX object src/scriptengine/generator/generator/CMakeFiles/qtscript_gui.dir/generated_cpp/com_trolltech_qt_gui/qtscriptshell_QTextCharFormat.o                                                                                                                                 
make[1]: *** [src/scriptengine/generator/generator/CMakeFiles/qtscript_gui.dir/all] Error 2                                                 
make: *** [all] Error 2                                                                                                                     
 *       src/scriptengine/generator/generator/generated_cpp/com_trolltech_qt_gui/qtscriptshell_QTextCodecPlugin.cpp is not even being generated now.
fresh src download, clean build dir.
Comment 57 Ian Monroe 2009-02-18 18:47:06 UTC
SVN commit 927982 by ianmonroe:

no idea why it was compiling for me before this change, I didn't have
the QTextCodePlugin files in the gui directory. But it was really. :)
BUG: 177863

 M  +0 -1      qtscript_gui.cmake  


WebSVN link: http://websvn.kde.org/?view=rev&revision=927982
Comment 58 Dan Coats 2009-02-18 21:28:09 UTC
_QWindowsStyle.o                                                                                                                            
/var/tmp/portage/media-sound/amarok-9999/work/amarok_build/src/scriptengine/generator/generator/generated_cpp/com_trolltech_qt_gui/qtscriptshell_QWindowsStyle.cpp: In member function 'virtual QPixmap QtScriptShell_QWindowsStyle::standardPixmap(QStyle::StandardPixmap, const QStyleOption*, const QWidget*) const':                                                                                                            
/var/tmp/portage/media-sound/amarok-9999/work/amarok_build/src/scriptengine/generator/generator/generated_cpp/com_trolltech_qt_gui/qtscriptshell_QWindowsStyle.cpp:342: warning: control reaches end of non-void function                                                               
[ 90%] Building CXX object src/scriptengine/generator/generator/CMakeFiles/qtscript_gui.dir/generated_cpp/com_trolltech_qt_gui/qtscriptshell_QWizard.o                                                                                                                                  
[ 90%] Building CXX object src/scriptengine/generator/generator/CMakeFiles/qtscript_gui.dir/generated_cpp/com_trolltech_qt_gui/qtscriptshell_QWizardPage.o                                                                                                                              
[ 90%] Building CXX object src/scriptengine/generator/generator/CMakeFiles/qtscript_gui.dir/generated_cpp/com_trolltech_qt_gui/qtscriptshell_QWorkspace.o                                                                                                                               
[ 90%] Building CXX object src/scriptengine/generator/generator/CMakeFiles/qtscript_gui.dir/generated_cpp/com_trolltech_qt_gui/qtscriptshell_QColorDialog.o                                                                                                                             
[ 90%] Building CXX object src/scriptengine/generator/generator/CMakeFiles/qtscript_gui.dir/generated_cpp/com_trolltech_qt_gui/qtscriptshell_QFontDialog.o                                                                                                                              
[ 90%] Building CXX object src/scriptengine/generator/generator/CMakeFiles/qtscript_gui.dir/generated_cpp/com_trolltech_qt_gui/qtscriptshell_QInputDialog.o                                                                                                                             
Linking CXX shared module ../../../../lib/libqtscript_gui.so                                                                                
[ 90%] Built target qtscript_gui                                                                                                            
make: *** [all] Error 2                                                                                                                     
 *
Comment 59 Ian Monroe 2009-02-18 21:41:55 UTC
@Coats you didn't paste the compile error.
Comment 60 Dan Coats 2009-02-18 21:50:03 UTC
sorry ian, it just happend a lot further up this time...

 39%] [32mBuilding CXX object src/scriptengine/generator/generator/CMakeFiles/qtscript_core.dir/generated_cpp/com_trolltech_qt_core/qtscriptshell_QTextCodecPlugin.o
[0m[ 39%] [32mBuilding CXX object src/scriptengine/generator/generator/CMakeFiles/qtscript_gui.dir/generated_cpp/com_trolltech_qt_gui/qtscript_QFocusFrame.o
[0m/var/tmp/portage/media-sound/amarok-9999/work/amarok_build/src/scriptengine/generator/generator/generated_cpp/com_trolltech_qt_xml/qtscript_QDomComment.cpp:46: warning: 'QScriptValue qtscript_QDomComment_prototype_call(QScriptContext*, QScriptEngine*)' defined but not used
[ 39%] [32mBuilding CXX object src/scriptengine/generator/generator/CMakeFiles/qtscript_xml.dir/generated_cpp/com_trolltech_qt_xml/qtscript_QDomDocument.o
[0m/usr/include/qt4/QtCore/qmetatype.h: In static member function 'static int QMetaTypeId2<T>::qt_metatype_id() [with T = QList<int>]':
/usr/include/qt4/QtCore/qmetatype.h:194:   instantiated from 'int qMetaTypeId(T*) [with T = QList<int>]'
/usr/include/qt4/QtScript/qscriptengine.h:367:   instantiated from 'T qscriptvalue_cast(const QScriptValue&) [with T = QList<int>]'
/var/tmp/portage/media-sound/amarok-9999/work/amarok_build/src/scriptengine/generator/generator/generated_cpp/com_trolltech_qt_core/qtscriptshell_QTextCodecPlugin.cpp:128:   instantiated from here
/usr/include/qt4/QtCore/qmetatype.h:184: error: 'qt_metatype_id' is not a member of 'QMetaTypeId<QList<int> >'
make[2]: *** [src/scriptengine/generator/generator/CMakeFiles/qtscript_core.dir/generated_cpp/com_trolltech_qt_core/qtscriptshell_QTextCodecPlugin.o] Error 1
make[1]: *** [src/scriptengine/generator/generator/CMakeFiles/qtscript_core.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 39%] [32mBuilding CXX object src/scriptengine/generator/generator/CMakeFiles/qtscript_xml.dir/generated_cpp/com_trolltech_qt_xml/qtscript_QDomDocumentFragment.o
[0m[ 39%] [32mBuilding CXX object src/CMakeFiles/amaroklib.dir/services/ServiceCollectionTreeView.o
Comment 61 Dan Coats 2009-02-18 21:53:32 UTC
Still no <int> defined

# head -n 30 /var/tmp/portage/media-sound/amarok-9999/work/amarok_build/src/scriptengine/generator/generator/generated_cpp/com_trolltech_qt_core/qtscriptshell_QTextCodecPlugin.cpp
#include "qtscriptshell_QTextCodecPlugin.h"

#include <QtScript/QScriptEngine>
#include <QVariant>
#include <qbytearray.h>
#include <qcoreevent.h>
#include <qlist.h>
#include <qobject.h>
#include <qstringlist.h>
#include <qtextcodec.h>

#define QTSCRIPT_IS_GENERATED_FUNCTION(fun) ((fun.data().toUInt32() & 0xFFFF0000) == 0xBABE0000)

Q_DECLARE_METATYPE(QList<QByteArray>)
Q_DECLARE_METATYPE(QChildEvent*)
Q_DECLARE_METATYPE(QTextCodec*)
Q_DECLARE_METATYPE(QEvent*)
Q_DECLARE_METATYPE(QTimerEvent*)

QtScriptShell_QTextCodecPlugin::QtScriptShell_QTextCodecPlugin(QObject*  parent)
    : QTextCodecPlugin(parent) {}

QtScriptShell_QTextCodecPlugin::~QtScriptShell_QTextCodecPlugin() {}

QList<QByteArray >  QtScriptShell_QTextCodecPlugin::aliases() const
{
    QScriptValue _q_function = __qtscript_self.property("aliases");
    if (!_q_function.isFunction() || QTSCRIPT_IS_GENERATED_FUNCTION(_q_function)
        || (__qtscript_self.propertyFlags("aliases") & QScriptValue::QObjectMember)) {
        qFatal("QTextCodecPlugin::aliases() is abstract!");
Comment 62 Ian Monroe 2009-02-18 21:59:31 UTC
ah dang, the same thing. :/ Brings us back to wondering why the qmake version is any different.
Comment 63 Ian Monroe 2009-02-18 22:17:58 UTC
Hmm well I do have the Q_DECLARE_METATYPE(QList<int>) line.

Can you confirm that the Trolltech git-repo generator does produce that line?
Comment 64 Markos Chandras 2009-02-18 22:33:22 UTC
Fyi, amarok-2.0.1.1 compiles fine with qt-4.5.0_rc1 on my laptop. This is a brand new kde-4.2 installation with qt-4.5. I dont know how helpfull can this be , but let me know if I can provide you some specific information about my system or my enviroment in order to help you narrow down this issue.

I am using Gentoo Linux i686 with gcc-4.3.2
Comment 65 Dan Coats 2009-02-18 22:47:25 UTC
Ian, what exactly are you asking me to do? I have rebuilt all qt-* from git today, I have cleared all cache, removed previous build dir and even amarok svn dir and attempted rebuild, but get the above failure.
Comment 66 Ian Monroe 2009-02-19 01:38:24 UTC
@Dan to try git://labs.trolltech.com/qtscriptgenerator
Comment 67 Dan Coats 2009-02-19 16:13:39 UTC
Ian, I get errors building the bindings plugins from git qtscriptgenerator.

g++ -c -pipe -march=native -O2 -pipe -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_SCRIPT_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtScript -I/usr/include/qt4 -I. -Irelease -I. -o release/qtscriptshell_QFutureIterator.o ../../generated_cpp/com_trolltech_qt_core/qtscriptshell_QFutureIterator.cpp
../../generated_cpp/com_trolltech_qt_core/qtscriptshell_QFutureIterator.cpp: In constructor 'QtScriptShell_QFutureIterator::QtScriptShell_QFutureIterator()':
../../generated_cpp/com_trolltech_qt_core/qtscriptshell_QFutureIterator.cpp:10: error: no matching function for call to 'QFutureIterator<QScriptValue>::QFutureIterator()'
/usr/include/qt4/QtCore/qfuture.h:186: note: candidates are: QFutureIterator<T>::QFutureIterator(const QFuture<T>&) [with T = QScriptValue]
/usr/include/qt4/QtCore/qfuture.h:186: note:                 QFutureIterator<QScriptValue>::QFutureIterator(const QFutureIterator<QScriptValue>&)
make[2]: *** [release/qtscriptshell_QFutureIterator.o] Error 1
make[2]: Leaving directory `/root/qtscript/qtscriptgenerator/qtbindings/qtscript_core'
make[1]: *** [release] Error 2
make[1]: Leaving directory `/root/qtscript/qtscriptgenerator/qtbindings/qtscript_core'
make: *** [sub-qtscript_core-make_default] Error 2
Comment 68 Dan Coats 2009-02-19 17:54:38 UTC
i can build until qt-phonon with generator --include-paths=/usr/include/qt4
but as clas said , we use phonon "KDE multimedia API" not qt-phonon so that is to be expected. Are we still going in circles?
Comment 69 Ian Monroe 2009-02-19 18:17:03 UTC
Well yes we're in circles. I didn't really ask you to build, just look to see if the  Q_DECLARE_METATYPE(QList<int>) is produced or any other differences in the generated code.

Anyways I think you should be able to skip through the phonon problems with a make -k.
Comment 70 Dan Coats 2009-02-19 18:47:52 UTC
sorry ian, i was confused :/
anyway, yes it generates with (QList<int>)

com_trolltech_qt_core # head -n 30 qtscriptshell_QTextCodecPlugin.cpp
#include "qtscriptshell_QTextCodecPlugin.h"

#include <QtScript/QScriptEngine>
#include <QVariant>
#include <qbytearray.h>
#include <qcoreevent.h>
#include <qlist.h>
#include <qobject.h>
#include <qstringlist.h>
#include <qtextcodec.h>

#define QTSCRIPT_IS_GENERATED_FUNCTION(fun) ((fun.data().toUInt32() &
0xFFFF0000) == 0xBABE0000)

Q_DECLARE_METATYPE(QList<QByteArray>)
Q_DECLARE_METATYPE(QChildEvent*)
Q_DECLARE_METATYPE(QTextCodec*)
Q_DECLARE_METATYPE(QEvent*)
Q_DECLARE_METATYPE(QList<int>)
Q_DECLARE_METATYPE(QTimerEvent*)
Comment 71 Ian Monroe 2009-02-19 19:44:49 UTC
Coats: Can you run `grep QT_INCLUDE_DIR:PATH CMakeCache.txt` in your Amarok build dir? Just to double check your generating againist the same Qt headers.
Comment 72 Dan Coats 2009-02-19 19:53:19 UTC
# grep QT_INCLUDE_DIR:PATH CMakeCache.txt
QT_INCLUDE_DIR:PATH=/usr/include/qt4
QT_QT_INCLUDE_DIR:PATH=/usr/include/qt4/Qt
Comment 73 Dan Coats 2009-02-19 21:31:48 UTC
Ian, I dont know... I can cd /amarok/src/scriptengine/generator/generator && qmake && make && ./generator --include-paths=/usr/include/qt4 && cd ../qtbindings && qmake && make ... from that the qtscriptshell_QTextCodecPlugin.cpp is generated correctly.

But building amarok from src/build_dir/ does not generate it correctly.
Comment 74 Mieszko Ślusarczyk 2009-02-22 17:46:28 UTC
Created attachment 31546 [details]
Another build.log.

I tried to build amarok, but still no luck. Patch attached before, doesn't apply anymore, though it fixed amarok 2.0.1.1
Comment 75 Mike Dilger 2009-02-23 01:30:06 UTC
I get this bug too.  On a newly installed gentoo kde-4.2.0_r2 build (just kde-base and then amarok), amarok 2.0.1.1 fails to build for me (using the gentoo emerge) at about 84%:

src/scriptengine/generator/generator/generated_cpp/com_trolltech_qt_gui/qtscriptshell_QTextCodecPlugin.cpp:128:   instantiated from here
/usr/include/qt4/QtCore/qmetatype.h:184: error: ‘qt_metatype_id’ is not a member of ‘QMetaTypeId<QList<int> >’

amarok-svn r929769 also fails to build, at about 10%:

/usr/include/qt4/QtCore/qmetatype.h: In static member function ‘static int QMetaTypeId2<T>::qt_metatype_id() [with T = QList<int>]’:
/usr/include/qt4/QtCore/qmetatype.h:194:   instantiated from ‘int qMetaTypeId(T*) [with T = QList<int>]’
/usr/include/qt4/QtScript/qscriptengine.h:367:   instantiated from ‘T qscriptvalue_cast(const QScriptValue&) [with T = QList<int>]’
/usr/local/git/amarok-svn/amarok-r929769-build/src/scriptengine/generator/generator/generated_cpp/com_trolltech_qt_core/qtscriptshell_QTextCodecPlugin.cpp:128:  instantiated from here
/usr/include/qt4/QtCore/qmetatype.h:184: error: ‘qt_metatype_id’ is not a member of ‘QMetaTypeId<QList<int> >’

(I have QT3 installed in /usr/qt/3, but QTDIR=/usr and no path references /usr/qt/3 at the moment.  furthermore, KDE built fine).
Comment 76 Mieszko Ślusarczyk 2009-02-23 20:44:21 UTC
Last patch fixes that problem.
I've made an ebuild with patch, available at my overlay:

http://github.com/spitfire/spitfire-overlay/tree/master

To add type:

layman -f -o http://github.com/spitfire/spitfire-overlay/raw/master/spitfire-overlay.list -a spitfire-overlay
Comment 77 simon 2009-02-26 15:00:56 UTC
hi,

can't compile svn now, as the patch in #46 doesn't apply anymore (qt-svn + kde-svn):

[  4%] Building CXX object src/scriptengine/generator/generator/CMakeFiles/qtscript_core.dir/generated_cpp/com_trolltech_qt_core/qtscriptshell_QTextCodecPlugin.o
In Datei, eingefügt von /usr/include/qt4/QtCore/qconfig.h:3,
                 von /usr/include/qt4/QtCore/qglobal.h:57,
                 von /usr/include/qt4/QtCore/qnamespace.h:40,
                 von /usr/include/qt4/QtCore/qobjectdefs.h:40,
                 von /usr/include/qt4/QtCore/qobject.h:42,
                 von /usr/include/qt4/QtCore/qplugin.h:40,
                 von /usr/include/qt4/QtCore/qtextcodecplugin.h:40,
                 von /home/user/kde/build/amarok/src/scriptengine/generator/generator/generated_cpp/com_trolltech_qt_core/qtscriptshell_QTextCodecPlugin.h:4,
                 von /home/user/kde/build/amarok/src/scriptengine/generator/generator/generated_cpp/com_trolltech_qt_core/qtscriptshell_QTextCodecPlugin.cpp:1:
/usr/include/qt4/Gentoo/gentoo-qconfig.h:19:1: Warnung: »QT_WEBKIT« redefiniert
<Kommandozeile>:1:1: Warnung: dies ist die Stelle der vorherigen Definition
/usr/include/qt4/QtCore/qmetatype.h: In static member function »static int QMetaTypeId2<T>::qt_metatype_id() [with T = QList<int>]«:
/usr/include/qt4/QtCore/qmetatype.h:194:   instantiated from »int qMetaTypeId(T*) [with T = QList<int>]«
/usr/include/qt4/QtScript/qscriptengine.h:367:   instantiated from »T qscriptvalue_cast(const QScriptValue&) [with T = QList<int>]«
/home/user/kde/build/amarok/src/scriptengine/generator/generator/generated_cpp/com_trolltech_qt_core/qtscriptshell_QTextCodecPlugin.cpp:128:   instantiated from here
/usr/include/qt4/QtCore/qmetatype.h:184: Fehler: »qt_metatype_id« ist kein Element von »QMetaTypeId<QList<int> >«
make[2]: *** [src/scriptengine/generator/generator/CMakeFiles/qtscript_core.dir/generated_cpp/com_trolltech_qt_core/qtscriptshell_QTextCodecPlugin.o] Fehler 1
make[1]: *** [src/scriptengine/generator/generator/CMakeFiles/qtscript_core.dir/all] Fehler 2
make: *** [all] Fehler 2
Comment 78 Eelko Berkenpies 2009-03-01 12:56:23 UTC
I also experience(d) the same problem as reported in comment #77 with:

Fedora 10 / KDE 4.2
qt-4.5.0-0.4.rc1.fc10.i386
gcc-4.3.2-7.i386
Amarok SVN revision 933539

Although I was able to fix it and successfully build Amarok by applying the patch from comment #46 to src/scriptengine/generator/generator/typesystem_core.xml instead of src/scriptengine/generator/generator/typesystem_gui.xml.

I personally don't have that much experience with creating patches, it's on my todo list (I'm in a learning phase). If someone could wrap it up sooner, feel free to do so. :)
Comment 79 Eelko Berkenpies 2009-03-01 13:14:25 UTC
Created attachment 31715 [details]
Patch to have the latest SVN version compiled with Qt 4.5

Thanks to markey for pointing out on how to create the patch.
Comment 80 Shlomi Fish 2009-03-04 18:39:47 UTC
Can reproduce it here on Mandriva Cooker.
Comment 81 Matthew Schnee 2009-03-05 00:22:28 UTC
I don't have a real 'patch' for anybody, but if amarok is failing to compile using Qt-4.5 and you're getting the "qt_metatype_id" error, what's necessary is to add the following lines in a header file of each project spitting out that error:


#include <QMetaType>
Q_DECLARE_METATYPE( QList<int > );

Or if you want to be old-school and typedef-safe:

#include <QMetaType>
typedef QList<int > IntList;
Q_DECLARE_METATYPE( IntList );

For example, I added these lines to the following files in the 2.0.1.1 checkout:
src/scriptengine/generator/generator/generated_cpp/com_trolltech_qt_gui/qtscriptshell_QTextCodecPlugin.h
src/scriptengine/generator/generator/shellimplgenerator.h

Again, this is for people trying to compile using Qt-4.5.0 who are getting qt_metatype_id errors in reference to Qlist<int >/scriptcasting.  No patch from me, sorry.
Comment 82 Taurnil 2009-03-06 02:58:19 UTC
Just to let you know with qt-4.5.0, kde-4.2.1, I get this failure during make;

[ 90%] Building CXX object src/scriptengine/generator/generator/CMakeFiles/qtscript_gui.dir/generated_cpp/com_trolltech_qt_gui/qtscriptshell_QTextFrame.o
/opt/lunar/qt/4/include/QtCore/qmetatype.h: In static member function 'static int QMetaTypeId2<T>::qt_metatype_id() [with T = QList<int>]':
/opt/lunar/qt/4/include/QtCore/qmetatype.h:199:   instantiated from 'int qMetaTypeId(T*) [with T = QList<int>]'
/opt/lunar/qt/4/include/QtScript/qscriptengine.h:372:   instantiated from 'T qscriptvalue_cast(const QScriptValue&) [with T = QList<int>]'
/usr/src/amarok-2.0.2/src/scriptengine/generator/generator/generated_cpp/com_trolltech_qt_gui/qtscriptshell_QTextCodecPlugin.cpp:128:   instantiated from here
/opt/lunar/qt/4/include/QtCore/qmetatype.h:189: error: 'qt_metatype_id' is not a member of 'QMetaTypeId<QList<int> >'
make[2]: *** [src/scriptengine/generator/generator/CMakeFiles/qtscript_gui.dir/generated_cpp/com_trolltech_qt_gui/qtscriptshell_QTextCodecPlugin.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [src/scriptengine/generator/generator/CMakeFiles/qtscript_gui.dir/all] Error 2
make: *** [all] Error 2
Comment 83 Taurnil 2009-03-06 03:03:21 UTC
Sorry, forgot to mention #82 is with amarok-2.0.2
Comment 84 Leo Franchi 2009-03-06 03:05:35 UTC
I don't mean to curtail the use of further comments. But I think we have all
agreed that there is a bug, the problem is with the declaration of
MetaTypeId<QList<int> >, and that we're not sure how to fix it. Neither is kent
hansen (author of the bindings).

however, the plan is to push kent to make a release of the generator(+bindings
possibly?) separate from amarok and depend on that. that way it will make it
easier to identify and eliminate the problem.

thanks to all the users who contributed outputs and patches and the like :)
Comment 85 Ian Monroe 2009-03-07 07:37:45 UTC
SVN commit 936142 by ianmonroe:

If cmake detects that the script generator is already installed, it does not
build it. If the script generator isn't installed it works like before. As with
all build system changes, some testing would be appreciated.

At some point in the next couple of weeks Amarok will refuse to build
without the QtScript Generator already installed. You can download the
binding generator seperately at http://code.google.com/p/qtscriptgenerator/downloads/list
This is what Amarok 2.1 will be doing. Users having trouble building the generator
with cmake can use this now.

177863 is closed for sure. :>

CCMAIL: amarok@kde.org
BUG: 177863

 M  +7 -1      CMakeLists.txt  
 A             cmake/modules/CheckQtScriptBindings.cmake  
 A             cmake/modules/QtScriptBindingsTest.cpp   [License: Public Domain LGPL (v2.1+)]


WebSVN link: http://websvn.kde.org/?view=rev&revision=936142
Comment 86 Mark Kretschmann 2009-03-07 09:23:52 UTC
Nice step forward, but now we've just moved the problem to another place:

The qtscriptgenerator-src-0.1.0 itself fails to build here, so we are running in circles :)

For me as a developer the main problem is not the patching of Amarok - the patch (from Eelko) works fine. But how do I commit to Amarok without committing this patch as well?
Comment 87 Benjamin Reed 2009-03-07 18:08:57 UTC
So what is the correct way to make things work with Qt/Mac 4.5 + amarok 2.0.2?

I've tried the patch against amarok 2.0.2 and it doesn't match up; I've tried downloading the qtscriptgenerator 0.1.0 but the bindings fail to compile:

g++ -c -pipe -g -Wall -W -fPIC -DQT_PHONON_LIB -DQT_SCRIPT_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/sw/lib/qt4-mac/mkspecs/macx-g++ -I. -I/sw/lib/qt4-mac/lib/QtCore.framework/Versions/4/Headers -I/sw/lib/qt4-mac/include/QtCore -I/sw/lib/qt4-mac/lib/QtGui.framework/Versions/4/Headers -I/sw/lib/qt4-mac/include/QtGui -I/sw/lib/qt4-mac/lib/QtScript.framework/Versions/4/Headers -I/sw/lib/qt4-mac/include/QtScript -I/sw/lib/qt4-mac/lib/phonon.framework/Versions/4/Headers -I/sw/lib/qt4-mac/include/phonon -I/sw/lib/qt4-mac/include -I. -Idebug -I. -F/sw/lib/qt4-mac/lib -o debug/qtscript_AudioOutputDevice.o ../../generated_cpp/com_trolltech_qt_phonon/qtscript_AudioOutputDevice.cpp
../../generated_cpp/com_trolltech_qt_phonon/qtscript_AudioOutputDevice.cpp:50: error: redefinition of ‘struct QMetaTypeId<Phonon::AudioOutputDevice>’
/sw/lib/qt4-mac/lib/phonon.framework/Versions/4/Headers/objectdescription.h:319: error: previous definition of ‘struct QMetaTypeId<Phonon::AudioOutputDevice>’
make[2]: *** [debug/qtscript_AudioOutputDevice.o] Error 1
make[1]: *** [debug] Error 2

I'm trying to package Amarok 2.0.2 for Fink (on OSX), just looking for at least one solution that works.  =)
Comment 88 Mieszko Ślusarczyk 2009-03-09 12:42:07 UTC
amarok 2.0.2 still fails to compile with the first patch (though it applies cleanly). The svn patch doesn''t even apply. Building against qt4.5 final.
Comment 89 Mieszko Ślusarczyk 2009-03-09 12:43:54 UTC
Created attachment 31946 [details]
build.log for amarok 2.0.2 + first patch
Comment 90 Ian Monroe 2009-03-09 20:18:05 UTC
Mieszko: for SVN, build the qtscriptgenerator separately as I suggested in the last commit message.

Markey: we aren't moving in circles, because if you can't build the qtscriptgenerator you can just report that to upstream directly at http://code.google.com/p/qtscriptgenerator/issues/list

See now I don't have to deal with the various issues. I call that progress. :D
Comment 91 Mieszko Ślusarczyk 2009-03-10 00:40:59 UTC
Ian, but qtscriptgenerator fails to build to (filed a bug), so I can only have amarok 2.0.1.1 with patch:/
Qtscriptgenerator doesn't look really good...with last commit ~20 days ago and a long list of bugs.
Is there any other way to build 2.0.2 against final qt 4.5?
Comment 92 Rashad Tatum 2009-03-12 12:28:57 UTC
I still get the error with the latest svn checkout.
Comment 93 Benjamin Reed 2009-03-12 12:57:19 UTC
Rashad, the "Patch to have the latest SVN version compiled with Qt 4.5" works for me against SVN.

I guess that begs the question, why is this bug marked fixed if that needs to be integrated still?
Comment 94 Leo Franchi 2009-03-12 13:01:00 UTC
it is marked fixed because we are in a "temporary transition" phase. we will be removing the scriptgenerator soon from amarok svn itself, as there is already a package available. that package will be a hard amarok dependency soon.
Comment 95 Eelko Berkenpies 2009-03-12 13:06:08 UTC
More info about getting the qtscriptgenerator packed for your distro: http://mail.kde.org/pipermail/amarok/2009-March/007811.html
Comment 96 Benjamin Reed 2009-03-12 13:08:37 UTC
OK, I guess that just moves where I need to send bug reports then.  :)  The scriptgenerator tarball there fails against Qt 4.5 somewhere in the phonon stuff.  Thanks.
Comment 97 Rashad Tatum 2009-03-12 18:26:24 UTC
Thanks, Benjamin Reed.  Your patch fixed my problem.
Comment 98 Rashad Tatum 2009-03-13 04:56:24 UTC
(In reply to comment #97)
> Thanks, Benjamin Reed.  Your patch fixed my problem.

Oops.  Thanks Benjamin for point me to Eelko's patch.  Thanks Eelko for the patch.
Comment 99 Rashad Tatum 2009-03-13 04:57:08 UTC
(In reply to comment #97)
> Thanks, Benjamin Reed.  Your patch fixed my problem.

Oops.  Thanks Benjamin for pointing me to Eelko's patch.  Thanks Eelko for the patch.
Comment 100 Keith Rusler 2009-03-15 05:18:05 UTC
I now get this error. No more errors without the Eelko patch.

In file included from /var/tmp/portage/media-sound/amarok-9999/work/amarok_build/src/scriptengine/generator/generator/generated_cpp/com_trolltech_qt_core/qtscript_QtConcurrent.cpp:10:
/usr/include/qt4/QtCore/qtconcurrentreducekernel.h: In member function 'bool QtConcurrent::ReduceKernel<ReduceFunctor, ReduceResultType, T>::shouldThrottle()':
/usr/include/qt4/QtCore/qtconcurrentreducekernel.h:214: error: 'QThreadPool' has not been declared
/usr/include/qt4/QtCore/qtconcurrentreducekernel.h: In member function 'bool QtConcurrent::ReduceKernel<ReduceFunctor, ReduceResultType, T>::shouldStartThread()':
/usr/include/qt4/QtCore/qtconcurrentreducekernel.h:220: error: 'QThreadPool' has not been declared
make[2]: *** [src/scriptengine/generator/generator/CMakeFiles/qtscript_core.dir/generated_cpp/com_trolltech_qt_core/qtscript_QtConcurrent.o] Error 1
make[1]: *** [src/scriptengine/generator/generator/CMakeFiles/qtscript_core.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Comment 101 wyldrodney 2009-03-16 12:10:18 UTC
Revision 940006 builds properly with this patch:  https://bugs.kde.org/attachment.cgi?id=31715.

Thanks to Eelko Berkenpies ;)

Gentoo x86_64. 2.6.28-gentoo-r3. GCC-4.3.3. Qt-4.5.0. KDE-4.2.1. C{,XX}FLAGS="-O2 -pipe"
Comment 102 Wang Hoi 2009-03-27 15:15:02 UTC
i encounter the same error with #100 (with qt-copy, kde svn, amarok svn)
i'm using http://repo.or.cz/r/qtscriptgenerator/amarok.git
here's the patch:
--- generator/typesystem_core.xml	2009-03-27 21:51:27.000000000 +0800
+++ generator/typesystem_core.xml	2009-03-27 21:46:31.000000000 +0800
@@ -2087,6 +2087,7 @@
   
   <namespace-type name="QtConcurrent" target-type="class">
     <extra-includes>
+        <include file-name="QThreadPool" location="global"/>
         <include file-name="qtconcurrentreducekernel.h" location="global"/>
         <include file-name="qtconcurrentthreadengine.h" location="global"/>
     </extra-includes>