Results 1 to 7 of 7

Thread: Undefined Reference To...

  1. #1

    Red face Undefined Reference To...

    I'm trying to buid application that uses Iris XMPP together with QCA (http://delta.affinix.com/), but when I compile my application I got following errors.

    Build Issues:
    undefined reference to 'ntohs@4'
    ...
    ...

    Compile Output:
    ../iris/lib/libiris.a(s5b.o):s5b.cpp.text+0xf23d): undefined reference to `ntohs@4'
    ../iris/lib/libirisnet.a(jdns_mdnsd.o):jdns_mdnsd.c.text+0x108c): undefined reference to `htons@4'
    ...
    ...

    QCA and Iris compiles without build issues and I have added includepath and libs from Iris as well.

    What that undefined reference to ... means?

    All replies are welcome.

  2. #2
    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: Undefined Reference To...

    undefined reference generally means that the mentioned function is not defined. You should seek a solution in the networking part of the code cuz these functions are used while networking.

  3. #3

    Default Re: Undefined Reference To...

    But, what does it mean? Missing binaries? Missing libraries? Missing headers or...?

  4. #4
    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: Undefined Reference To...

    this primarily means that the function is not defined..so i'll guess its a missing library cuz its a linking error. Also, according to me, those functions are common network library functions which are used to convert the byte orders when transferring from one place to another. so, its definitely a networking library that is missing

  5. #5

    Default Re: Undefined Reference To...

    But libiris.a and libirisnet.a exists, as I have compiled Iris successfully and I have added the libraries to my pro file like this:

    LIBS += -L$$PWD/../iris/lib \
    -liris \
    -lirisnet

    And the path is correct so I'm puzzled.

  6. #6
    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: Undefined Reference To...

    well, googling ur specific error, i found that sm other people have also had this problem..sm cuz of compiler issue and some had not included libraries..

    http://www.gammon.com.au/forum/bbsho...ubject_id=2574

    see this, if it helps..reason of this error is DEFINITELY that the lib is missing

  7. #7

    Default Re: Undefined Reference To...

    Ok thanks for all the answers. Maybe the problem is, that the compiler doesn't see the library files, even though they exist. So perhaps I should add that path to enviromental variable PATH or copy manually the files so that the linker will find the libraries...

Similar Threads

  1. Unable to install QT 4.4.0 from sources
    By debnathm in forum Installation and Deployment
    Replies: 4
    Last Post: 6th August 2008, 07:43
  2. how to add static library into qmake
    By Namrata in forum Qt Tools
    Replies: 1
    Last Post: 20th November 2007, 18:33
  3. MS Sql native driver??
    By LordQt in forum Qt Programming
    Replies: 4
    Last Post: 9th October 2007, 14:41
  4. error undefined reference ...............
    By amit_pansuria in forum Qt Programming
    Replies: 2
    Last Post: 8th June 2007, 15:28
  5. how to correctly compile threads support?
    By srhlefty in forum Installation and Deployment
    Replies: 9
    Last Post: 25th June 2006, 20:15

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.