max
max

Reputation:

Undefined reference errors in gcc

gcc link results with errors:

dns.cpp: undefined reference to '__res_querydomain'
dns.cpp: undefined reference to '__dn_skipname'    
dns.cpp: undefined reference to '__dn_expand'
dns.cpp: undefined reference to '__res_query'

Is there another library that I need to link to?

Upvotes: 2

Views: 5346

Answers (1)

sgooch
sgooch

Reputation: 41

Adding -lresolv solved this for me.

Upvotes: 4

Related Questions