Results 1 to 4 of 4

Thread: Undifined refrence to Qbyte problem

  1. #1
    Join Date
    Oct 2011
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows Maemo/MeeGo

    Default Undifined refrence to Qbyte problem

    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

  2. #2
    Join Date
    May 2011
    Posts
    239
    Thanks
    4
    Thanked 35 Times in 35 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Symbian S60

    Default Re: Undifined refrence to Qbyte problem

    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.

  3. #3
    Join Date
    Oct 2011
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows Maemo/MeeGo

    Default Re: Undifined refrence to Qbyte problem

    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";
    }
    }

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Undifined refrence to Qbyte problem

    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?

Similar Threads

  1. Replies: 4
    Last Post: 19th January 2011, 21:18
  2. Undifined Refrence: vtable
    By mweber1488 in forum Newbie
    Replies: 10
    Last Post: 5th January 2011, 17:28
  3. error: undefined refrence
    By motsh in forum Qt for Embedded and Mobile
    Replies: 5
    Last Post: 3rd May 2009, 15:22
  4. silly undefined refrence to main
    By quickNitin in forum Newbie
    Replies: 3
    Last Post: 16th November 2006, 09:41
  5. QString ~ QByte error
    By mhoover in forum Qt Programming
    Replies: 2
    Last Post: 7th March 2006, 20:01

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.