PDA

View Full Version : Undifined refrence to Qbyte problem



m.azeemanwar
27th December 2011, 08:48
hi
i develop an application which is running good on desktop and qt simulator.but when i build or even make a new project and add cpp and .h files
i got build issues as "more undifined refrence qbyteArray ....." and out put of application is



c:/QtSDK/Madde/sysroots/harmattan-nokia-meego-arm-sysroot-1122-slim/usr/include/qt4/QtCore/qbytearray.h:550: undefined reference to `QByteArray::~QByteArray()'
c:/QtSDK/Madde/sysroots/harmattan-nokia-meego-arm-sysroot-1122-slim/usr/include/qt4/QtCore/qbytearray.h:552: undefined reference to `QByteArray::~QByteArray()'
c:/QtSDK/Madde/sysroots/harmattan-nokia-meego-arm-sysroot-1122-slim/usr/include/qt4/QtCore/qbytearray.h:548: undefined reference to `QByteArray::~QByteArray()'
c:/QtSDK/Madde/sysroots/harmattan-nokia-meego-arm-sysroot-1122-slim/usr/include/qt4/QtDeclarative/qdeclarative.h:165: undefined reference to `QByteArray::~QByteArray()'
c:/QtSDK/Madde/sysroots/harmattan-nokia-meego-arm-sysroot-1122-slim/usr/include/qt4/QtDeclarative/qdeclarative.h:188: undefined reference to `QByteArray::~QByteArray()'
obj/main.o:c:/QtSDK/Madde/sysroots/harmattan-nokia-meego-arm-sysroot-1122-slim/usr/include/qt4/QtDeclarative/qdeclarative.h:188: more undefined references to `QByteArray::~QByteArray()' follow
collect2: ld returned 1 exit status
make: *** [Test2] Error 1
The process "C:\qtsdk\madde\bin\make.exe" exited with code 2.
Error while building project Test2 (target: Harmattan)
When executing build step 'Make'



please help me

mvuori
27th December 2011, 10:31
What you didn't mention is that you are building a project for Harmattan now (either on purpose or by accident) and your Harmattan SDK files just might be out of date. Install the latest Qt SDK and try again.

m.azeemanwar
27th December 2011, 12:48
i remove all qdebug and a qml register file code ...and rebuild again this is work fine
but now i got face another problem is i wanna to read a .txt file bt failded my code is working good for symbian and desktop application.cud you plz tel me what is happening code is

void GraphicsEngine::loadPawnLocations(){
// bool isComment = false;
QString sToken;
int index;
int x_pos = 0;
int y_pos = 0;

QFile file("qml/Test2/pawnPosition.txt");

QStringList strings;

if (file.open(QIODevice::ReadOnly | QIODevice::Text))
{

QTextStream in(&file);
char tmp;
in>>index;
in>>tmp;
in>>x_pos;
in>>tmp;
in>>y_pos;
while (!in.atEnd() ) {

if (index >= PathMap::JOURNY_CELLS
&& index < PathMap::JOURNY_CELLS + PathMap::HOME_STREET_CELLS) {

pawnsInHomeStreet[index
- PathMap::JOURNY_CELLS][X_POS] = x_pos;
pawnsInHomeStreet[index
- PathMap::JOURNY_CELLS][Y_POS] = y_pos;

} /**
* locations for the pawns in castle
* */
else if (index
>= PathMap::JOURNY_CELLS + PathMap::HOME_STREET_CELLS) {
pawnsInCastleLocations[index - PathMap::JOURNY_CELLS
- PathMap::HOME_STREET_CELLS][X_POS] = x_pos;
pawnsInCastleLocations[index - PathMap::JOURNY_CELLS
- PathMap::HOME_STREET_CELLS][Y_POS] = y_pos;

} /**
* Normally traveling
* */
else {
pawnLocations[index][X_POS] = x_pos;
pawnLocations[index][Y_POS] = y_pos;
}
strings.clear();

in>>index;
in>>tmp;
in>>x_pos;
in>>tmp;
in>>y_pos;



}
}else
{
exit(1);
// qDebug()<<"file not open";
}
}

ChrisW67
28th December 2011, 22:25
Could you tell what the code is doing? Given that the source code works elsewhere my best guess is that the file does not exist in the specified location on the affected device. What is the current working directory of the application?