qt-copy compile problem

Ralf Habacker ralf.habacker at freenet.de
Sat Feb 24 17:41:31 GMT 2007


Ch.Ehrlicher at gmx.de schrieb:
> Hi,
>
> I can't compile qt-copy on SuSE 10.2 x64 (corelib):
>
> g++ -c -m64 -pipe -g -I/opt/gnome/include/glib-2.0 -I/opt/gnome/lib64/glib-2.0/include -O2 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -D_REENTRANT -fPIC  -DQT_SHARED -DQT_BUILD_CORE_LIB -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_NO_DEBUG -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I/home/chehrlic/devel/kde/qt-copy/mkspecs/linux-g++-64 -I/home/chehrlic/devel/kde/qt-copy/src/corelib -I../../include -I../../include -I../../include/QtCore -Iglobal -I/home/chehrlic/devel/kde/qt-copy/src/corelib/.moc/release-shared -I.uic/release-shared -I. -o .obj/release-shared/moc_qbuffer.o .moc/release-shared/moc_qbuffer.cpp
> .moc/release-shared/moc_qbuffer.cpp: In member function ‘virtual int QBuffer::qt_metacall(QMetaObject::Call, int, void**)’:
> .moc/release-shared/moc_qbuffer.cpp:64: error: invalid use of undefined type ‘struct QBufferPrivate’
> .moc/release-shared/../../../../../qt-copy/src/corelib/io/qbuffer.h:35: error: forward declaration of ‘struct QBufferPrivate’
>
>
> I did a clean out-of-source build.
>
> Any ideas?
>   
This looks like the qmake problem I encountered with out of source build
on windows. By default qmake does not create  Makefile entries for
compiling moc_<sourcefile>.cpp if  moc_<sourcefile>.cpp is included in
the related sourcefile as happens for qbuffer.cpp. 

I have reported this to qt-bugs ->  Re: [Issue N148498] qmake/moc issue
on win32  and got the final answer below. It looks that this problems
happens on unix too in some cases. :-(

>> > > cd qt-source
>> > > configure -shared -qt-zlib -qt-png -release
>> > > cd ..
>> > > mkdir qt-build
>> > > cd qt-build
>> > > qmake ..\qt-source\src\corelib\corelib.pro
>> > > mingw32-make
>> > > ... wait until compile error comes
>> > >
>> > > -> it looks that qmake have problems to use out of source build
>> > >
>>     
> > I tried the above way using source snapshot from yesterday.
> >
> > Today evening I've updated source update using rsync and can only
> > reproduce this error (having moc_qbuffer.o rule in Makefile), when
> > in qt-build is a copy of .qmake.cache from qt-source.
> >
> > cd qt-build
> > copy ..\qt-source\.qmake.cache
> > qmake ..\qt-source\src\corelib\corelib.pro
> >
> > -> compile error occurs.
>   

You can't do a shadow build of Qt on Windows, this is not supported, you
need to build it in the directory that it was installed into. So you
should do:

	cd qt-source
	configure ...
	cd src
	mingw32-make

and it should build fine.

Regards,
Andy
--
Andy Shaw - Senior Support Engineer
Trolltech ASA, Oslo 


Ralf




More information about the kde-core-devel mailing list