PDA

View Full Version : error: undefined refrence



motsh
30th April 2009, 19:33
i have an error in ficgta01 sdk 4.3.2
header file:

#ifndef THIRD_H
#define THIRD_H
#include "ui_third.h"
#include "qcbsmessage.h"
#include <QVariant>
#include <QString>
#include<QWidget>
class third:public QWidget,private Ui_third
{

public:
third(QWidget*parent=0,Qt::WFlags f=0);
virtual ~third();
};
#endif
sourse file :

#include "third.h"
#include<QtopiaApplication>
third::third(QWidget*parent,Qt::WFlags f):QWidget(parent,f)
{
setupUi(this);
QCBSMessage *code1=new QCBSMessage();
const uint code=code1->messageCode() ;
QVariant *variant=new QVariant(code);
QString string=variant->toString();
lineEdit->setText(string);
}
third::~third(){}
error message :

.obj/debug-shared/third.o: In function `third':
/home/user/projects/third/third.cpp:6: undefined reference to `QCBSMessage::QCBSMessage()'
/home/user/projects/third/third.cpp:7: undefined reference to `QCBSMessage::messageCode() const'
/home/user/projects/third/third.cpp:6: undefined reference to `QCBSMessage::QCBSMessage()'
/home/user/projects/third/third.cpp:7: undefined reference to `QCBSMessage::messageCode() const'
collect2: ld returned 1 exit status
make[1]: *** [third] Error 1
make[1]: Leaving directory `/home/user/projects/third'
make: *** [all] Error 2
please any one tell me what's wrong
thanks

Lykurg
30th April 2009, 19:44
Please use the [ CODE ] tags for better reading, and try to add
#include "qcbsmessage.h" also in your source file.

motsh
1st May 2009, 14:11
third.cpp:

#include "third.h"
1-#include <QCBSMessage>
2-#include <QAtUtils>
3-#include <QCBSMessagePrivate>
4-#include <QSMSMessage>
5-#include <QtopiaApplication>
6-third::third(QWidget*parent,Qt::WFlags f):QWidget(parent,f)
7-{
8-setupUi(this);
9-QCBSMessage *code1=new QCBSMessage();
10-const uint code=code1->messageCode() ;
11-QVariant *variant=new QVariant(code);
12-QString string=variant->toString();
13-lineEdit->setText(string);
14-}
15-third::~third(){}
third.h:

#ifndef THIRD_H
1-#define THIRD_H
2-#include "ui_third.h"
3-#include <QVariant>
4-#include <QString>
5-#include<QWidget>
6-#include <QCBSMessage>
7-#include <QAtUtils>
8-#include <QCBSMessagePrivate>
9-#include <QSMSMessage>
10-#include <QtopiaApplication>
11-class third:public QWidget,private Ui_third
12-{
13-
14-public:
15-third(QWidget*parent=0,Qt::WFlags f=0);
16-virtual ~third();
17-};
18-#endif
Error message:

third.h:7:23: error: QCBSMessage: No such file or directory
third.h:8:20: error: QAtUtils: No such file or directory
third.h:9:30: error: QCBSMessagePrivate: No such file or directory
third.h:10:23: error: QSMSMessage: No such file or directory
make[2]: *** [.obj/release-shared/main.o] Error 1
make[2]: Leaving directory `/home/user/projects/third'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/user/projects/third'
make: *** [all] Error 2

motsh
1st May 2009, 14:40
hi
third.cpp:

#include "third.h"
#include "qcbsmessage.h"
#include "qatutils.h"
#include "qatresultparser.h"
#include "qgsmcodec.h"
#include "qsmsmessage.h"
#include <QtopiaApplication>
third::third(QWidget*parent,Qt::WFlags f):QWidget(parent,f)
{
setupUi(this);
QCBSMessage *code1=new QCBSMessage();
const uint code=code1->messageCode() ;
QVariant *variant=new QVariant(code);
QString string=variant->toString();
lineEdit->setText(string);
}
third::~third(){}
third.h:

#ifndef THIRD_H
#define THIRD_H
#include "ui_third.h"
#include <QVariant>
#include <QString>
#include<QWidget>
#include "qcbsmessage.h"
#include "qatutils.h"
#include "qatresultparser.h"
#include "qgsmcodec.h"
#include "qsmsmessage.h"
#include <QtopiaApplication>
class third:public QWidget,private Ui_third
{
public:
third(QWidget*parent=0,Qt::WFlags f=0);
virtual ~third();
};
#endif
Error message:

.obj/release-shared/qcbsmessage.o: In function `QCBSMessage::fromPdu(QByteArray const&)':
qcbsmessage.cpp:(.text+0x354): undefined reference to `QCBSDeliverMessage::QCBSDeliverMessage(QByteAay const&)'
qcbsmessage.cpp:(.text+0x364): undefined reference to `QCBSDeliverMessage::unpack(QTextCodec*)'
qcbsmessage.cpp:(.text+0x36c): undefined reference to `QPDUMessage::~QPDUMessage()'
.obj/release-shared/qcbsmessage.o: In function `QCBSMessage::toPdu() const':
qcbsmessage.cpp:(.text+0x5ec): undefined reference to `QCBSDeliverMessage::QCBSDeliverMessage()'
qcbsmessage.cpp:(.text+0x698): undefined reference to `QCBSDeliverMessage::pack(QCBSMessage const&, MSDataCodingScheme)'
qcbsmessage.cpp:(.text+0x704): undefined reference to `QPDUMessage::~QPDUMessage()'
collect2: ld returned 1 exit status
make[2]: *** [third] Error 1
make[2]: Leaving directory `/home/user/projects/third'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/user/projects/third'
make: *** [all] Error 2

i am sorry but i am confused
thanks indeed

motsh
2nd May 2009, 17:47
hi
i want to know what is the wrong in thos program,please

motsh
3rd May 2009, 15:22
i am able to build program well but i have another problem
when i write sdk -i,h get this error

user@qtopiasdk:~/projects/third$ sdk -i
Building /var/www/example_1.0.0-1_i386.qpd
Adding to index: example
Building /var/www/qpe-application_1.0.0-1_i386.qpd
Adding to index: qpe-application
Building /var/www/qpe-first_1.0.0-1_i386.qpd
Adding to index: qpe-first
Building /var/www/qpe-second_1.0.0-1_i386.qpd
Adding to index: qpe-second
Building /var/www/qpe-third_1.0.0-1_arm.qpd
Adding to index: qpe-third
Building /var/www/qpe-third_1.0.0-1_i386.qpd
Adding to index: qpe-third
Install process for qpe-third_1.0.0-1_arm.qpk successfully i nitiated
ssh_exchange_identification: Connection closed by remote host
please anybody can help me and tell me what is the reason of this error
i am using qt extended ficgta01 sdk 4.3.2