PDA

View Full Version : error In member function «virtual int QBuffer::qt_metacall(QMetaObject::Call, int, vo



chochatown
27th May 2009, 14:21
hello,
i have a probleme in the make of my qt project with C++,there is an error in the QT4 code that i dont have any idea cause is not me who develop this,so how can i do? what is the origine of this error
thx for your help dear QT developers ,i paste you the error :

<code>
-I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -Isrc -Iinc -IQtCore -IQtGui -I. -I. -o moc_qbuffer.o moc_qbuffer.cpp
moc_qbuffer.cpp: In member function «virtual int QBuffer::qt_metacall(QMetaObject::Call, int, void**)»:
moc_qbuffer.cpp:65: erreur: invalid use of incomplete type «struct QBufferPrivate»
QtCore/qbuffer.h:57: erreur: forward declaration of «struct QBufferPrivate»
make: *** [moc_qbuffer.o] Erreur 1

</code>

chochatown
27th May 2009, 15:40
i tried to install QT another time but no way to resolve the problem !
i develop with linuw Ubuntu and i compile as you see with gcc

faldzip
27th May 2009, 16:27
this error appears when you compile your own code or Qt sources? If your own, can you investigate what part of your own code causes error?

chochatown
28th May 2009, 16:16
this error comes when i compile my code but my code have not the error the error is in a line of the moc_qbuffer.cpp of Qt libraries i tried to find this close but i cant, exactly in the

function «virtual int QBuffer::qt_metacall(QMetaObject::Call, int, void**)»:

that sure my code call it from sequence of calls

is it because linux?i installed a new QT4 from installer but no way.


this the error again:

root@lassoued-laptop:/home/lassoued/ogr2gui-0.5# make
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -Isrc -Iinc -IQtCore -IQtGui -I. -I. -o moc_qbuffer.o moc_qbuffer.cpp
moc_qbuffer.cpp: In member function «virtual int QBuffer::qt_metacall(QMetaObject::Call, int, void**)»:
moc_qbuffer.cpp:65: erreur: invalid use of incomplete type «struct QBufferPrivate»
QtCore/qbuffer.h:57: erreur: forward declaration of «struct QBufferPrivate»
make: *** [moc_qbuffer.o] Erreur 1

chochatown
28th May 2009, 17:04
sur des forum j'ai vu que c'est un qmake que je dois fair,mais ou comment ...!!

est-ce la solution?

faldzip
28th May 2009, 20:42
can you show your code?

chochatown
28th May 2009, 21:46
now i changed to QT Creator is better i wish that's my code cause i have ew error here :

/home/lassoued/design/FormUI/Frm.cpp:5: erreur: invalid use of incomplete type «struct Ui::Frm»


that's the code:


#include "Frm.h"
#include "ui_Frm.h"

Frm::Frm(QWidget *parent)
: QMainWindow(parent), ui(new Ui::Frm)
{
ui->setupUi(this);
}

Frm::~Frm()
{
delete ui;
}







#ifndef FRM_H
#define FRM_H

#include <QtGui/QMainWindow>

namespace Ui
{
class Frm;
}

class Frm : public QMainWindow
{
Q_OBJECT

public:
Frm(QWidget *parent = 0);
~Frm();

private:
Ui::Frm *ui;
};

#endif // FRM_H

wysota
28th May 2009, 22:00
To me it seems you took some files from Qt sources, copied them to your project and tried to compile. This won't work, don't even try it - you have to link to Qt as a whole, you can't extract one or two classes from it.

chochatown
29th May 2009, 00:11
yes that what i would use but how i can link Qt?

wysota
29th May 2009, 08:01
This is not a forum that teaches you how to be a software developer. You should know how to use libraries in your applications.

faldzip
29th May 2009, 09:06
why do you want to copy Qt sources into your app sources?? Can't you just use the Qt classes from compiled library like any other Qt user?