Problem linking to htons, etc...

  • Follow


Can someone help me understand what I need to link to in order to get
the htons, etc... support?  Thanks!

gcc -mpa-risc-1-0 -pipe -ansi -Wall -O2 -ansi -fpic
-fhandle-exceptions -D__UNIX
__ -D__HPOV -DHP_UX -D_HPUX -D_POSIX_C_SOURCE=199506L
-D_XOPEN_SOURCE_EXTENDED -
D_INCLUDE_XOPEN_SOURCE_EXTENDED -D_INCLUDE_HPUX_SOURCE -D_REENTRANT
-I../../src/
driver -I.  -I../../export/include/hpux10
-I../../export/include/generic -I/home
/egriffin/IntelligentMonitor_31/im/export/bin/lcf_bundle.40/include/hpux10
-I../
.../pre_reqs/unix/usr/hpux10/OV/include -I../../src/topo
-I../../src/nls -ltbsmco
mmon -lflci -lnetviewmsg -L. -L../../export/lib/hpux10 
-L/tivoli/tools/bldenv/h
pux10/lib -L/tivoli/tools/295/hpux11/lib
-L/tivoli/tools/build/dev/hpux10/lib -L
/home/egriffin/IntelligentMonitor_31/im/export/bin/lcf_bundle.40/lib/hpux10
-L..
/../hpux10/common -L../../hpux10/nls -L../../hpux10/libmsg
-L../../pre_reqs/unix
/usr/hpux10/OV/lib -L/usr/lib -L/usr/ucblib -o tbsmdriver driver.o
-ltbsmcommon
-lflci -lnetviewmsg  || (rm -f tbsmdriver; exit 1)
/usr/bin/ld: Unsatisfied symbols:
   EGVC_PORT_SOCKET_CLOSE (code)
   WSAGetLastError (code)
   ntohl (code)
   htonl (code)
   htons (code)
   WSACleanup (code)
   gethostbyname_r (code)
/usr/bin/ld: (Warning) Linker features were used that may not be
supported in fu
ture releases. The +vallcompatwarnings option can be used to display
more detail
s, and the ld(1) man page contains additional information. This
warning can be s
uppressed with the +vnocompatwarnings option.
collect2: ld returned 1 exit status
0
Reply michaelthegriff 8/1/2003 1:31:32 PM

Erick wrote:
> 
> Can someone help me understand what I need to link to in order to get
> the htons, etc... support?  Thanks!
> 
> gcc -mpa-risc-1-0 -pipe -ansi -Wall -O2 -ansi -fpic
> -fhandle-exceptions -D__UNIX
> __ -D__HPOV -DHP_UX -D_HPUX -D_POSIX_C_SOURCE=199506L
> -D_XOPEN_SOURCE_EXTENDED -
> D_INCLUDE_XOPEN_SOURCE_EXTENDED -D_INCLUDE_HPUX_SOURCE -D_REENTRANT
> -I../../src/
> driver -I.  -I../../export/include/hpux10
> -I../../export/include/generic -I/home
> /egriffin/IntelligentMonitor_31/im/export/bin/lcf_bundle.40/include/hpux10
> -I../
> ../pre_reqs/unix/usr/hpux10/OV/include -I../../src/topo
> -I../../src/nls -ltbsmco
> mmon -lflci -lnetviewmsg -L. -L../../export/lib/hpux10
> -L/tivoli/tools/bldenv/h
> pux10/lib -L/tivoli/tools/295/hpux11/lib
> -L/tivoli/tools/build/dev/hpux10/lib -L
> /home/egriffin/IntelligentMonitor_31/im/export/bin/lcf_bundle.40/lib/hpux10
> -L..
> /../hpux10/common -L../../hpux10/nls -L../../hpux10/libmsg
> -L../../pre_reqs/unix
> /usr/hpux10/OV/lib -L/usr/lib -L/usr/ucblib -o tbsmdriver driver.o
> -ltbsmcommon
> -lflci -lnetviewmsg  || (rm -f tbsmdriver; exit 1)
> /usr/bin/ld: Unsatisfied symbols:
>    EGVC_PORT_SOCKET_CLOSE (code)
>    WSAGetLastError (code)
>    ntohl (code)
>    htonl (code)
>    htons (code)
>    WSACleanup (code)
>    gethostbyname_r (code)
> /usr/bin/ld: (Warning) Linker features were used that may not be
> supported in fu
> ture releases. The +vallcompatwarnings option can be used to display
> more detail
> s, and the ld(1) man page contains additional information. This
> warning can be s
> uppressed with the +vnocompatwarnings option.
> collect2: ld returned 1 exit status


Tray adding -lnsl
that has worked for me with HP 11.00 and 10.20


-- 
http://ftp.opensysmon.com is a shell script archive site with an
open source system monitoring and network monitoring software package.
Many platforms are supplied already compiled.
0
Reply scriptOmatic 8/1/2003 4:44:21 PM


scriptOmatic <ScriptOmatic@chironcomputing.com> wrote:
> Erick wrote:
>> Can someone help me understand what I need to link to in order to get
>> the htons, etc... support?  Thanks!
> Tray adding -lnsl
> that has worked for me with HP 11.00 and 10.20

Hmm, I didn't know that there were routines for those in nsl.  Anyhow,
given that HP-UX runs big-endian (PA-RISC and Itanium) htons etc are
all noops, so the better way is to get the macros included that make
them simply fade away:

$ man htons

 byteorder(3N)                                                 byteorder(3N)

 NAME
      htonl(), htons(), ntohl(), ntohs() - convert values between host and
      network byte order

 SYNOPSIS
      #include <netinet/in.h>

      _XOPEN_SOURCE_EXTENDED only
      #include <arpa/inet.h>

If your application includes one of those .h files, it shouldn't be
necessary to link against nsl.

rick jones
-- 
a wide gulf separates "what if" from "if only"
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to raj in cup.hp.com  but NOT BOTH...
0
Reply Rick 8/1/2003 5:52:47 PM

You need to include <netinet/in.h> (man htons) in your source file. 
These are macros, not actual functions, so you can't link them in.

michaelthegriff@yahoo.com (Erick) wrote in message news:<76eb2907.0308010531.434c633f@posting.google.com>...
> Can someone help me understand what I need to link to in order to get
> the htons, etc... support?  Thanks!
> 
> gcc -mpa-risc-1-0 -pipe -ansi -Wall -O2 -ansi -fpic
> -fhandle-exceptions -D__UNIX
> __ -D__HPOV -DHP_UX -D_HPUX -D_POSIX_C_SOURCE=199506L
> -D_XOPEN_SOURCE_EXTENDED -
> D_INCLUDE_XOPEN_SOURCE_EXTENDED -D_INCLUDE_HPUX_SOURCE -D_REENTRANT
> -I../../src/
> driver -I.  -I../../export/include/hpux10
> -I../../export/include/generic -I/home
> /egriffin/IntelligentMonitor_31/im/export/bin/lcf_bundle.40/include/hpux10
> -I../
> ../pre_reqs/unix/usr/hpux10/OV/include -I../../src/topo
> -I../../src/nls -ltbsmco
> mmon -lflci -lnetviewmsg -L. -L../../export/lib/hpux10 
> -L/tivoli/tools/bldenv/h
> pux10/lib -L/tivoli/tools/295/hpux11/lib
> -L/tivoli/tools/build/dev/hpux10/lib -L
> /home/egriffin/IntelligentMonitor_31/im/export/bin/lcf_bundle.40/lib/hpux10
> -L..
> /../hpux10/common -L../../hpux10/nls -L../../hpux10/libmsg
> -L../../pre_reqs/unix
> /usr/hpux10/OV/lib -L/usr/lib -L/usr/ucblib -o tbsmdriver driver.o
> -ltbsmcommon
> -lflci -lnetviewmsg  || (rm -f tbsmdriver; exit 1)
> /usr/bin/ld: Unsatisfied symbols:
>    EGVC_PORT_SOCKET_CLOSE (code)
>    WSAGetLastError (code)
>    ntohl (code)
>    htonl (code)
>    htons (code)
>    WSACleanup (code)
>    gethostbyname_r (code)
> /usr/bin/ld: (Warning) Linker features were used that may not be
> supported in fu
> ture releases. The +vallcompatwarnings option can be used to display
> more detail
> s, and the ld(1) man page contains additional information. This
> warning can be s
> uppressed with the +vnocompatwarnings option.
> collect2: ld returned 1 exit status
0
Reply chris_rorvick 8/1/2003 7:47:44 PM

3 Replies
255 Views

(page loaded in 0.069 seconds)

Similiar Articles:













7/25/2012 7:19:40 PM


Reply: