[gnutls-devel] undefined reference to htons and ntohs (Android)

A. Klitzing aklitzing at gmail.com
Fri Nov 7 13:50:15 CET 2014


Hi,

I compiled gnutls 3.3.9 for Android with Googles NDK (standalone toolchain)
and get some linker errors. The library will be built but some cmdline
tools don't....
I can successfully build gnutls 3.3.6.

Any hints for me? It would be enough if I can disable the build of any
cmdline tool.


[...]
Making all in src
Making all in gl
Making all in libopts
  CCLD     gnutls-cli-debug
  CCLD     certtool
  CCLD     ocsptool
  CCLD     danetool
  CCLD     gnutls-serv
socket.o:socket.c:function port_to_service: error: undefined reference to
'htons'
socket.o:socket.c:function service_to_port: error: undefined reference to
'ntohs'
collect2: error: ld returned 1 exit status
Makefile:1754: recipe for target 'gnutls-serv' failed
make[8]: *** [gnutls-serv] Error 1
make[8]: *** Waiting for unfinished jobs....
socket.o:socket.c:function port_to_service: error: undefined reference to
'htons'
socket.o:socket.c:function service_to_port: error: undefined reference to
'ntohs'
collect2: error: ld returned 1 exit status
Makefile:1742: recipe for target 'danetool' failed
make[8]: *** [danetool] Error 1
socket.o:socket.c:function port_to_service: error: undefined reference to
'htons'
socket.o:socket.c:function service_to_port: error: undefined reference to
'ntohs'
collect2: error: ld returned 1 exit status
socket.o:socket.c:function port_to_service: error: undefined reference to
'htons'
socket.o:socket.c:function service_to_port: error: undefined reference to
'ntohs'
collect2: error: ld returned 1 exit status
[...]

Best regards
   André Klitzing
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/attachments/20141107/3cc2f127/attachment-0001.html>


More information about the Gnutls-devel mailing list