PDA

View Full Version : Undefined Reference To...



ManuMies
10th February 2009, 08:25
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+0x1 08c): 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. :)

talk2amulya
10th February 2009, 09:44
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.

ManuMies
10th February 2009, 11:36
But, what does it mean? Missing binaries? Missing libraries? Missing headers or...?

talk2amulya
10th February 2009, 11:55
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

ManuMies
10th February 2009, 12:00
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. :crying:

talk2amulya
10th February 2009, 12:06
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/bbshowpost.php?bbsubject_id=2574

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

ManuMies
10th February 2009, 12:14
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...