Results 1 to 10 of 10

Thread: qFromBigEndian(...) not found??

  1. #1
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Thanks
    40
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default qFromBigEndian(...) not found??

    Hi,

    I have trivial question:
    I can use all the functions from the QtGlobal, but when I try to use one of these
    Qt Code:
    1. T qFromBigEndian ( const uchar * src )
    2. T qFromBigEndian ( T src )
    3. T qFromLittleEndian ( const uchar * src )
    4. T qFromLittleEndian ( T src )
    To copy to clipboard, switch view to plain text mode 

    I get an error pointing that the functions' declarations cannot be found( as I haven't included the header).

    I have checked it many times I can use other functions and features from this QtGlobal, but not the mentioned functions.

    {ADDED}
    I have checked the global.h and I have no declaration of the qFromBigEndian(...) etc.
    Where are these functions declared then?

    Thanks
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: qFromBigEndian(...) not found??

    Hi, try including <qendian.h> or <QtEndian>.
    J-P Nurmi

  3. #3
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qFromBigEndian(...) not found??

    its in <qendian.h>

  4. #4
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Thanks
    40
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: qFromBigEndian(...) not found??

    yes, I have found that, but when I include the
    qendian.h I get a "undefined ref to qFromBigEndian(...)" while linking.

    Qt Code:
    1. /usr/local/Trolltech/Qt-4.4.3/include/QtCore/qendian.h:327: undefined reference to `unsigned char const* qbswap<unsigned char const*>(unsigned char const*)'
    2. collect2: ld returned 1 exit status
    To copy to clipboard, switch view to plain text mode 
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

  5. #5
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qFromBigEndian(...) not found??

    well, this function is inside Corelib in source..so it must be in QtCore

  6. #6
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Thanks
    40
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: qFromBigEndian(...) not found??

    I have included :
    Qt Code:
    1. #include <QtCore>
    2. #include <endian.h>
    To copy to clipboard, switch view to plain text mode 

    still "underfined ref".
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

  7. #7
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: qFromBigEndian(...) not found??

    use #include <QtGlobal>
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  8. #8
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Thanks
    40
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: qFromBigEndian(...) not found??

    Done that already.

    Qt Code:
    1. #include <QtGlobal>
    2. #include <QtCore>
    3. #include <qtendian.h>
    To copy to clipboard, switch view to plain text mode 
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

  9. #9
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qFromBigEndian(...) not found??

    r u sure u hv lib file of qtcore added in the project settings?

  10. #10
    Join Date
    Apr 2009
    Posts
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Wink Re: qFromBigEndian(...) not found??

    For sure the user had found a solution or a workaround now.

    For the others, coming here by google's or yahoo or whatever search engine you like, the solution reside in 'data type'iing, because C++ class templates are a bit touchy about that.

    For example:


    • qFromBigEndian(*(quint16 *)(socket->read( 2 ).data())) : compile well under Ubuntu 8.x/Qt 4.5
    • qFromBigEndian(*(socket->read( 2 ).data())) : DOES NOT compile well under Ubuntu 8.x/Qt 4.5


    Maybe because the compiler doesn't know how to choose between QByteArray methods
    char * data ()
    const char * data () const

Similar Threads

  1. Visual Studio 2005 Express
    By Muzz in forum Installation and Deployment
    Replies: 22
    Last Post: 6th November 2008, 06:21
  2. qt4.4.0 using windows, moc.exe not found
    By graubrust in forum Installation and Deployment
    Replies: 2
    Last Post: 9th July 2008, 09:35
  3. Program crashes with assert error in xcb_lock.c
    By Valheru in forum Qt Programming
    Replies: 3
    Last Post: 18th November 2007, 19:56
  4. KDE 3.5.0 crash while opening project
    By MarkoSan in forum KDE Forum
    Replies: 2
    Last Post: 19th October 2007, 16:21
  5. Qt 4.3.0 lots of Bugs!
    By VireX in forum Qt Programming
    Replies: 69
    Last Post: 20th June 2007, 22:05

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.