msantos / sods

Socket over DNS tunnel
http://listincomprehension.com/2009/11/sods-socket-over-dns-tunneling-service.html
71 stars 17 forks source link

Undefined reference to '__dn_expand' #1

Closed victorhooi closed 12 years ago

victorhooi commented 12 years ago

Hi,

I'm attempting to compile sods on Ubuntu 11.10 (AMD64), and I am getting the following error:

~/sods/sods$ make
gcc -DHAVE_ERR -DHAVE_SEND -lresolv -g -Wall -o sods sods.c sods_handler.c sods_dns.c sods_io.c                 sods_q.c sods_sock.c sods_priv.c sods_err.c base32.c base64.c
/tmp/cc2CTnFv.o: In function `sds_dns_getdn':
/home/victorhooi/sods/sods/sods_dns.c:82: undefined reference to `__dn_expand'
collect2: ld returned 1 exit status
make: *** [all] Error 1

Any ideas?

Cheers, Victor

victorhooi commented 12 years ago

Hi,

Hmm, I found that manually adding "-lresolv" to the end of the GCC line in the Makefile works - however, "-lresolv" is already party of the LIB line, so I'm not sure why it didn't work there?

CC=gcc                                                                                                                                                                               
RM=rm                                                                                                                                                                                
APP=sods                                                                                                                                                                             

DEF=-DHAVE_ERR -DHAVE_SEND                                                                                                                                                           
LIB=-lresolv                                                                                                                                                                         

all:                                                                                                                                                                                 
    $(CC) $(DEF) $(LIB) -g -Wall -o sods sods.c sods_handler.c sods_dns.c sods_io.c         sods_q.c sods_sock.c sods_priv.c sods_err.c base32.c base64.c -lresolv                   

clean:                                                                                                                                                                               
    -@$(RM) sods *.o 

Cheers, Victor

msantos commented 12 years ago

Hey Victor! Try adding the path to libresolv.a. This works for me:

gcc -DHAVE_ERR -DHAVE_SEND -g -Wall -o sods sods.c sods_handler.c sods_dns.c sods_io.c sods_q.c sods_sock.c sods_priv.c sods_err.c base32.c base64.c /usr/lib/x86_64-linux-gnu/libresolv.a

msantos commented 12 years ago

Just saw your update, thanks! That is even better! I will update the configure script.