PDA

View Full Version : Compiler Error: declared as a `virtual' field, expected `;' before '(' token



niko
24th March 2006, 19:25
I'm trying to compile my PetManager (posted allready some time ago on win32) - now on Linux, and i get this error:


g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/doc/qt-4.1.1/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXml -I/usr/include/qt4 -I. -I../libs/dataobjects -I. -I. -o ObjectFactory.o ObjectFactory.cpp
In file included from ObjectFactory.h:3,
from ObjectFactory.cpp:1:
../libs/dataobjects/abstractfactory.h:14: error: `newObject' declared as a `virtual' field
../libs/dataobjects/abstractfactory.h:14: error: expected `;' before '(' token


what does that mean?

I attached the sources of the library i use and of the application.

to compile do this:


unpack attached file
export CPPLIBS=absolutepath to libs-dir (used by qmake-scripts)
cd libs
qmake
make
cd ..
cd PetManager
qmake
make


thanks!!

wysota
25th March 2006, 09:05
Try adding #include <QString> in abstractfactory.h.

niko
25th March 2006, 14:21
much, much thanks!!!
its working great now....