Operating System - HP-UX
1752806 Members
5999 Online
108789 Solutions
New Discussion юеВ

Re: Undefined symbols "if_indextoname" & "setlinebuf"

 
jagobbur
Occasional Advisor

Undefined symbols "if_indextoname" & "setlinebuf"

gcc objects/prod/mDNSPosix.c.o objects/prod/mDNSUNP.c.o objects/prod/mDNSDebug.c
.o objects/prod/GenLinkedList.c.o objects/prod/DNSDigest.c.o objects/prod/uDNS.c
.o objects/prod/DNSCommon.c.o objects/prod/NetMonitor.c.o -o build/prod/mDNSNetM
onitor -lnsl -lm
ld: Unsatisfied symbol "if_indextoname" in file objects/prod/NetMonitor.c.o
ld: Unsatisfied symbol "setlinebuf" in file objects/prod/NetMonitor.c.o
2 errors.
collect2: ld returned 1 exit status
gmake: *** [build/prod/mDNSNetMonitor] Error 1

Pls let me know which linkline is missing here.
Even i tried including '-lc' option still the same issue.
11 REPLIES 11
jagobbur
Occasional Advisor

Re: Undefined symbols "if_indextoname" & "setlinebuf"

This issue is in hpux platform
Suraj K Sankari
Honored Contributor

Re: Undefined symbols "if_indextoname" & "setlinebuf"

Hi,
If possible please reinstall gcc.
and check
Suraj
Dennis Handly
Acclaimed Contributor

Re: Undefined symbols "if_indextoname" & "setlinebuf"

>Even I tried including -lc option still the same issue.

Never do this, remove -lc since added by the driver.

Do you know where those functions are defined and what they do?
You can search mass quantities by using:
nm -pxAN lib-paths | grep -e if_indextoname -e setlinebuf
jagobbur
Occasional Advisor

Re: Undefined symbols "if_indextoname" & "setlinebuf"

This function shall map an interface index to its corresponding name.
jagobbur
Occasional Advisor

Re: Undefined symbols "if_indextoname" & "setlinebuf"

After running nm command it says file or directory not found.
bash-3.00$ nm -pxAN lib-paths | grep -e if_indextoname -e setlinebuf
/usr/local/packages/compiler/usr/ccs/lbin/nm32: No such file or directory
Dennis Handly
Acclaimed Contributor

Re: Undefined symbols "if_indextoname" & "setlinebuf"

Ok, there is a man page for each.
if_indextoname(3) says to use -lipv6, unless on 11.31.
setlinebuf(3) seems to be in libc but why would you use it instead of Standard setvbuf(3)? It seems to only be in 11.31.
Dennis Handly
Acclaimed Contributor

Re: Undefined symbols "if_indextoname" & "setlinebuf"

>nm -pxAN lib-paths | grep -e if_indextoname -e setlinebuf
>/usr/local/packages/compiler/usr/ccs/lbin/nm32: No such file or directory

You need to replace lib-paths to something like /usr/lib/lib*

nm(1) is in /usr/ccs/bin. Make sure it is in your PATH before the foreign devil /usr/local/bin.
jagobbur
Occasional Advisor

Re: Undefined symbols "if_indextoname" & "setlinebuf"

First symbol I am able to resolve by adding linklin option "-lipv6"
I need help on second sumbol i.e.ld: Unsatisfied symbol "setlinebuf" in file objects/prod/NetMonitor.c.o
jagobbur
Occasional Advisor

Re: Undefined symbols "if_indextoname" & "setlinebuf"

I am going to use 'setvbuf' instead of 'setlinebuf' is that fine?