【问题标题】:Undefined reference errors in gccgcc 中未定义的引用错误
【发布时间】:2014-05-23 00:38:39
【问题描述】:

gcc 链接结果有错误:

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'

我需要链接到另一个库吗?

【问题讨论】:

  • 我添加了-llibresolv,但现在我得到:/lib/bin/ld: 找不到-llibresolv

标签: gcc


【解决方案1】:

添加 -lresolv 为我解决了这个问题。

【讨论】:

  • 请不要将此类解决方案添加为答案。请在问题本身下方添加诸如 cmets 之类的解决方案..
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-10-16
  • 2014-03-04
  • 2014-04-21
  • 2012-12-12
相关资源
最近更新 更多