error C2504: 'array_data' : base class undefined

软件和网站开发以及相关技术探讨
回复
jili_baoer
帖子: 11
注册时间: 2007-08-04 10:04

error C2504: 'array_data' : base class undefined

#1

帖子 jili_baoer » 2007-08-29 14:58

  • 我在用C++ test 对.cpp文件build test时,就报C:\Qt\3.3.4\include\qbitarray.h(186) : error C2504: 'array_data' : base class undefined的错误,不知怎么解决呢!!
    qbitarray.h中
    #ifndef QBITARRAY_H
    #define QBITARRAY_H

    #ifndef QT_H
    #include "qstring.h"
    #endif // QT_H


    /*****************************************************************************
    QBitVal class; a context class for QBitArray::operator[]
    *****************************************************************************/

    class QBitArray;

    class Q_EXPORT QBitVal
    {
    private:
    QBitArray *array;
    uint index;
    public:
    QBitVal( QBitArray *a, uint i ) : array(a), index(i) {}
    operator int();
    QBitVal &operator=( const QBitVal &v );
    QBitVal &operator=( bool v );
    };


    /*****************************************************************************
    QBitArray class
    *****************************************************************************/

    class Q_EXPORT QBitArray : public QByteArray
    {
    public:
    QBitArray();
    QBitArray( uint size );
    QBitArray( const QBitArray &a ) : QByteArray( a ) {}

    QBitArray &operator=( const QBitArray & );

    uint size() const;
    bool resize( uint size );

    bool fill( bool v, int size = -1 );

    void detach();
    QBitArray copy() const;

    bool testBit( uint index ) const;
    void setBit( uint index );
    void setBit( uint index, bool value );
    void clearBit( uint index );
    bool toggleBit( uint index );

    bool at( uint index ) const;
    QBitVal operator[]( int index );
    bool operator[]( int index ) const;

    QBitArray &operator&=( const QBitArray & );
    QBitArray &operator|=( const QBitArray & );
    QBitArray &operator^=( const QBitArray & );
    QBitArray operator~() const;

    protected:
    struct bitarr_data : public QGArray::array_data {

    在qgarry.h中已经定义,且qstring.h中已经include“qgarry.h”

    #ifndef QGARRAY_H
    #define QGARRAY_H

    #ifndef QT_H
    #include "qshared.h"
    #endif // QT_H


    class Q_EXPORT QGArray // generic array
    {
    friend class QBuffer;
    public:
    // do not use this, even though this is public
    // ### make protected or private in Qt 4.0 beta?
    struct array_data : public QShared
回复