AnyChat技术支持论坛

标题: 编译出错:Undefined symbols std::_List_node_base::hook [打印本页]

作者: zorovip    时间: 2014-3-24 11:40
标题: 编译出错:Undefined symbols std::_List_node_base::hook
编译SDK包里面你们提供的源代码工程没有问题,但是编译自己的工程就出错,编译不通过,出错信息下问题:
Undefined symbols for architecture i386:
  "std::_List_node_base::hook(std::_List_node_base*)", referenced from:
      CControlCenter::LeaveRoom(int) in libanychatcore.a(ControlCenter.o)
      CControlCenter::GetOnlineUser(std::list<unsigned int, std::allocator<unsigned int> >*) in libanychatcore.a(ControlCenter.o)
      CControlCenter::RegisterBitrateStatistItem(unsigned int, unsigned int, unsigned int) in libanychatcore.a(ControlCenter.o)
      CControlCenter::OnAppChangeP2PPolitic(SDK_P2P_POLITIC) in libanychatcore.a(ControlCenter.o)
      CSubscriptHelper::OnSubscriptOtherUserStream(unsigned int, unsigned int, unsigned int, signed char) in libanychatcore.a(ControlCenter.o)
      CNetworkCenter::SendBuf(unsigned int, char*, unsigned int, unsigned int, unsigned int, unsigned int) in libanychatcore.a(NetworkCenter.o)
      CBufferTransMgr::OnMediaTransBufReSend(GV_MEDIA_PACK_TRANSBUF_RESEND_STRUCT*) in libanychatcore.a(buffertransmgr.o)
      ...
  "std::_List_node_base::unhook()", referenced from:
      CControlCenter::LeaveRoom(int) in libanychatcore.a(ControlCenter.o)
      CControlCenter::RegisterBitrateStatistItem(unsigned int, unsigned int, unsigned int) in libanychatcore.a(ControlCenter.o)
      CControlCenter::OnAppChangeP2PPolitic(SDK_P2P_POLITIC) in libanychatcore.a(ControlCenter.o)
      CSubscriptHelper::ResetStatus() in libanychatcore.a(ControlCenter.o)
      CSubscriptHelper::CancelUserAllSubScript(unsigned int) in libanychatcore.a(ControlCenter.o)
      CSubscriptHelper::OnSubscriptOtherUserStream(unsigned int, unsigned int, unsigned int, signed char) in libanychatcore.a(ControlCenter.o)
      CNetworkCenter::OnSocketWrite(unsigned int, unsigned int) in libanychatcore.a(NetworkCenter.o)
      ...

怎么办?

作者: admin    时间: 2014-3-24 11:51
您好,根据您提供的信息判断编译已经通过,是在链接(Link)过程中出错,建议通过如下两个步骤来解决:
1、Build Settings-->Apple LLVM 5.1 - Language - C++ --> C++ Standard Library,设置为:libstdc++(GNU C++ standard library)

然后Clean工程,然后重新Build,看是否可以成功。

2、Build Phases --> Link Binary With Libraries里面增加库:libstdc++.dylib

Clean工程,然后重新Build,应该可以Build成功。

作者: admin    时间: 2014-3-24 11:52
如果按上面的方法设置,问题依然存在,则可尝试:在“Project-->Build Phases-->Link Binary With Libraryes”里面添加库“libstdc++.6.dylib”,如下图所示:



详情可参考:http://bbs.anychat.cn/forum.php? ... =806&extra=page%3D1




作者: zorovip    时间: 2014-3-24 11:56
你好,谢谢版主,问题已经解决,太感谢了!




欢迎光临 AnyChat技术支持论坛 (http://bbs.anychat.cn/) Powered by Discuz! X3