我在QT3上编译下载的qextserialport没问题 ,但在QTE2.3.10下编译就出现如下错误:
qextserialbase.h:174: ISO C++ forbids declaration of `Offset' with no type
qextserialbase.h:174: `Offset' declared as a `virtual' field
qextserialbase.h:174: parse error before `(' token
qextserialbase.h:205: ISO C++ forbids declaration of `Q_LONG' with no type
qextserialbase.h:205: `Q_LONG' declared as a `virtual' field
qextserialbase.h:205: parse error before `(' token
qextserialbase.h:206: ISO C++ forbids declaration of `Q_LONG' with no type
qextserialbase.h:206: `Q_LONG' declared as a `virtual' field
qextserialbase.h:206: declaration of `int QextSerialBase::Q_LONG'
qextserialbase.h:205: conflicts with previous declaration `int
QextSerialBase::Q_LONG'
qextserialbase.h:206: parse error before `(' token
qextserialbase.h:206: duplicate member `QextSerialBase::Q_LONG'
In file included from mainwindow.cpp:27:
posix_qextserialport.h:28: syntax error before `;' token
posix_qextserialport.h:43: ISO C++ forbids declaration of `Offset' with no type
posix_qextserialport.h:43: `Offset' declared as a `virtual' field
posix_qextserialport.h:43: parse error before `(' token
posix_qextserialport.h:63: ISO C++ forbids declaration of `Q_LONG' with no type
posix_qextserialport.h:63: `Q_LONG' declared as a `virtual' field
posix_qextserialport.h:63: parse error before `(' token
posix_qextserialport.h:64: ISO C++ forbids declaration of `Q_LONG' with no type
posix_qextserialport.h:64: `Q_LONG' declared as a `virtual' field
posix_qextserialport.h:64: declaration of `int Posix_QextSerialPort::Q_LONG'
posix_qextserialport.h:63: conflicts with previous declaration `int
Posix_QextSerialPort::Q_LONG'
posix_qextserialport.h:64: parse error before `(' token
posix_qextserialport.h:64: duplicate member `Posix_QextSerialPort::Q_LONG'
mainwindow.cpp: In function `int main(int, char**)':
mainwindow.cpp:89: cannot allocate an object of type `Posix_QextSerialPort'
mainwindow.cpp:89: because the following virtual functions are abstract:
/qt_tool/qte-host-2.3.10/include/qiodevice.h:119: virtual uint
QIODevice::size() const
/qt_tool/qte-host-2.3.10/include/qiodevice.h:126: virtual int
QIODevice::readBlock(char*, unsigned int)
/qt_tool/qte-host-2.3.10/include/qiodevice.h:128: virtual int
QIODevice::writeBlock(const char*, unsigned int)
make: *** [mainwindow.o] Error 1
试着修改qiodevice.h 的内容把unit int 前的virtual去掉这些错误都没有了 ,但是其它的库可能调用了
qiodevice 又有其它的错误 ,那为知道怎么修改 ,请指点一下 .
[ 此贴被wjydlut在2006-03-16 09:31重新编辑 ]