Hi
I have a weird compile error which is related to QVector :|
here's the error
make: Entering directory `/home/alireza/dev/qt/yoDownet-build-desktop-Qt_in_PATH_Debug'
g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_SQL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt/mkspecs/linux-g++ -I../yoDownet -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include/QtSql -I/usr/include -I. -I. -I../yoDownet -I. -o fileinfo.o ../yoDownet/yoUtils/fileinfo.cpp
In file included from ../yoDownet/yoUtils/fileinfo.h:7:0,
from ../yoDownet/yoUtils/fileinfo.cpp:1:
/usr/include/QtCore/qobject.h: In copy constructor 'UriStatus::UriStatus(const UriStatus&)':
../yoDownet/yoUtils/uristatus.h:6:7: instantiated from 'void QVector<T>::realloc(int, int) [with T = UriStatus]'
/usr/include/QtCore/qvector.h:337:3: instantiated from 'void QVector<T>::detach_helper() [with T = UriStatus]'
/usr/include/QtCore/qvector.h:398:9: instantiated from 'QVector<T>& QVector<T>::operator=(const QVector<T>&) [with T = UriStatus]'
../yoDownet/yoUtils/fileinfo.cpp:30:13: instantiated from here
/usr/include/QtCore/qobject.h:333:5: error: 'QObject::QObject(const QObject
&)' is private ../yoDownet/yoUtils/uristatus.h:6:7: error: within this context
In file included from /usr/include/QtCore/QVector:1:0,
from ../yoDownet/yoUtils/fileinfo.h:6,
from ../yoDownet/yoUtils/fileinfo.cpp:1:
/usr/include/QtCore/qvector.h: In member function 'void QVector<T>::realloc(int, int) [with T = UriStatus]':
/usr/include/QtCore/qvector.h:532:17: note: synthesized method 'UriStatus::UriStatus(const UriStatus&)' first required here
make: Leaving directory `/home/alireza/dev/qt/yoDownet-build-desktop-Qt_in_PATH_Debug'
make: *** [fileinfo.o] Error 1
18:44:36: The process "/usr/bin/make" exited with code 2.
Error while building project yoDownet (target: Desktop)
When executing build step 'Make'
make: Entering directory `/home/alireza/dev/qt/yoDownet-build-desktop-Qt_in_PATH_Debug'
g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_SQL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt/mkspecs/linux-g++ -I../yoDownet -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include/QtSql -I/usr/include -I. -I. -I../yoDownet -I. -o fileinfo.o ../yoDownet/yoUtils/fileinfo.cpp
In file included from ../yoDownet/yoUtils/fileinfo.h:7:0,
from ../yoDownet/yoUtils/fileinfo.cpp:1:
/usr/include/QtCore/qobject.h: In copy constructor 'UriStatus::UriStatus(const UriStatus&)':
../yoDownet/yoUtils/uristatus.h:6:7: instantiated from 'void QVector<T>::realloc(int, int) [with T = UriStatus]'
/usr/include/QtCore/qvector.h:337:3: instantiated from 'void QVector<T>::detach_helper() [with T = UriStatus]'
/usr/include/QtCore/qvector.h:398:9: instantiated from 'QVector<T>& QVector<T>::operator=(const QVector<T>&) [with T = UriStatus]'
../yoDownet/yoUtils/fileinfo.cpp:30:13: instantiated from here
/usr/include/QtCore/qobject.h:333:5: error: 'QObject::QObject(const QObject&)' is private
../yoDownet/yoUtils/uristatus.h:6:7: error: within this context
In file included from /usr/include/QtCore/QVector:1:0,
from ../yoDownet/yoUtils/fileinfo.h:6,
from ../yoDownet/yoUtils/fileinfo.cpp:1:
/usr/include/QtCore/qvector.h: In member function 'void QVector<T>::realloc(int, int) [with T = UriStatus]':
/usr/include/QtCore/qvector.h:532:17: note: synthesized method 'UriStatus::UriStatus(const UriStatus&)' first required here
make: Leaving directory `/home/alireza/dev/qt/yoDownet-build-desktop-Qt_in_PATH_Debug'
make: *** [fileinfo.o] Error 1
18:44:36: The process "/usr/bin/make" exited with code 2.
Error while building project yoDownet (target: Desktop)
When executing build step 'Make'
To copy to clipboard, switch view to plain text mode
class source
#ifndef FILEINFO_H
#define FILEINFO_H
#include <QObject>
#include <QString>
#include <QVector>
#include "uristatus.h"
{
Q_OBJECT
public:
explicit FileInfo
(QObject *parent
= 0);
void setIndex
(const QString &index
);
void setLength
(const QString &length
);
void setSelected
(const QString &selected
);
void setUris(const QVector<UriStatus> &uris);
QVector<UriStatus> uris() const;
private:
QVector<UriStatus> _uris;
};
#endif // FILEINFO_H
#ifndef FILEINFO_H
#define FILEINFO_H
#include <QObject>
#include <QString>
#include <QVector>
#include "uristatus.h"
class FileInfo : public QObject
{
Q_OBJECT
public:
explicit FileInfo(QObject *parent = 0);
void setIndex(const QString &index);
void setPath(const QString &path);
void setLength(const QString &length);
void setSelected(const QString &selected);
void setUris(const QVector<UriStatus> &uris);
QString index() const;
QString path() const;
QString length() const;
QString selected() const;
QVector<UriStatus> uris() const;
private:
QString _index;
QString _path;
QString _length;
QString _selected;
QVector<UriStatus> _uris;
};
#endif // FILEINFO_H
To copy to clipboard, switch view to plain text mode
if you want the whole source code, it's on the git repo
http://sourceforge.net/p/yodownet/git/..../tree/
or simply just clone it
git clone git://git.code.sf.net/p/yodownet/git yodownet-git
git clone git://git.code.sf.net/p/yodownet/git yodownet-git
To copy to clipboard, switch view to plain text mode
i really get confused by this error and i tried alot of ways, but when i comment declaration/definition of this
QVector<UriStatus> uris() const;
QVector<UriStatus> uris() const;
To copy to clipboard, switch view to plain text mode
then the project will compiled successfully
thanks
Bookmarks