Bug 27928

Summary: build failure with wrong moc version
Product: classpath Reporter: philippe.laporte
Component: awtAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: blocker CC: bug-classpath, gnu_andrew
Priority: P3    
Version: 0.91   
Target Milestone: 0.99.1   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2006-06-07 13:40:02

Description philippe.laporte 2006-06-07 11:52:40 UTC
during make of classpath, after configuring with 
./configure --with-jikes --enable-jni --enable-qt-peer --disable-gtk-peer
get
g++ -DHAVE_CONFIG_H -I. -I. -I../../../include -I../../../include -I../../../native/jni/classpath -I../../../native/target/Linux -I../../../native/target/generic -DQT_SHARED -I/usr/local/Trolltech/Qt-4.1.3/include -I/usr/local/Trolltech/Qt-4.1.3/include/QtCore -I/usr/local/Trolltech/Qt-4.1.3/include/QtGui -g -O2 -MT slotcallbacks.lo -MD -MP -MF .deps/slotcallbacks.Tpo -c slotcallbacks.cpp  -fPIC -DPIC -o .libs/slotcallbacks.o
slotcallbacks.cpp:200:31: error: slotcallbacks.moc.h: No such file or directory
make[4]: *** [slotcallbacks.lo] Error 1
.
.
.

Then, looking for files:

[laporte@mirl194046 classpath-0.91]$ find / -name slotcallbacks.moc.h2>/dev/null
[laporte@mirl194046 classpath-0.91]$ find / -name slotcallbacks.cpp 2>/dev/null
/home/laporte/downloads/classpath-0.91/native/jni/qt-peer/slotcallbacks.cpp
Comment 1 Michael Koch 2006-06-07 13:12:30 UTC
Subject: Re:   New: build failure with QT peers: missing file

On Wed, Jun 07, 2006 at 11:52:40AM -0000, philippe dot laporte at gatespacetelematics dot com wrote:
> during make of classpath, after configuring with 
> ./configure --with-jikes --enable-jni --enable-qt-peer --disable-gtk-peer
> get
> g++ -DHAVE_CONFIG_H -I. -I. -I../../../include -I../../../include
> -I../../../native/jni/classpath -I../../../native/target/Linux
> -I../../../native/target/generic -DQT_SHARED
> -I/usr/local/Trolltech/Qt-4.1.3/include
> -I/usr/local/Trolltech/Qt-4.1.3/include/QtCore
> -I/usr/local/Trolltech/Qt-4.1.3/include/QtGui -g -O2 -MT slotcallbacks.lo -MD
> -MP -MF .deps/slotcallbacks.Tpo -c slotcallbacks.cpp  -fPIC -DPIC -o
> .libs/slotcallbacks.o
> slotcallbacks.cpp:200:31: error: slotcallbacks.moc.h: No such file or directory
> make[4]: *** [slotcallbacks.lo] Error 1

You are using a wrong moc. The moc you use is not for Qt 4.1.4


Michael
Comment 2 Robert Schuster 2006-06-07 13:40:02 UTC
I suggest that the build mechanery should be changed to test for the correct moc version. Any M4 wizards around?
Comment 3 Rob 2007-07-17 00:54:22 UTC
I had this trouble with GCC 4.3 and edited: gcc-4_3-build/i686-pc-linux-gnu/libjava/classpath/native/jni/gtk-peer/Makefile (generated) to change "moc" to "moc-qt4"
Comment 4 Rob 2007-07-17 13:08:00 UTC
Results for 4.3.0 20070716 (experimental) testsuite on i686-pc-linux-gnu
http://gcc.gnu.org/ml/gcc-testresults/2007-07/msg00721.html
Comment 5 Rob 2009-01-11 19:44:02 UTC
This Bug still occurs with:
"gcc version 4.4.0 20090111 (experimental) [trunk revision 143259]"

1. Don't use cached valued of 'moc' for 'moc-qt4'.
2. Check default install location even if NOT on the path at:
# /usr/local/Trolltech/Qt-4.4.3/bin/moc -v
Qt Meta Object Compiler version 59 (Qt 4.4.3)
Comment 6 Andrew John Hughes 2013-05-26 13:33:13 UTC
This should be fixed by:

http://git.savannah.gnu.org/cgit/classpath.git/commit/?id=c814d82e5a435f93150cd28b7cf0f9d600ff400d

which stores the moc-qt4 check separately and uses it in preference.