在使用Xcode 6为iOS构建Poco C ++应用程序时,有没有其他人看到这些链接器警告?
ld: warning: direct access in std::__1::vector<Poco::Dynamic::Var, std::__1::allocator<Poco::Dynamic::Var> > const& Poco::Dynamic::Var::extract<std::__1::vector<Poco::Dynamic::Var, std::__1::allocator<Poco::Dynamic::Var> > >() const to global weak symbol typeinfo for std::__1::vector<Poco::Dynamic::Var, std::__1::allocator<Poco::Dynamic::Var> > means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in std::__1::vector<Poco::Dynamic::Var, std::__1::allocator<Poco::Dynamic::Var> > const& Poco::Dynamic::Var::extract<std::__1::vector<Poco::Dynamic::Var, std::__1::allocator<Poco::Dynamic::Var> > >() const to global weak symbol typeinfo for std::__1::vector<Poco::Dynamic::Var, std::__1::allocator<Poco::Dynamic::Var> > means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in std::__1::vector<Poco::Dynamic::Var, std::__1::allocator<Poco::Dynamic::Var> > const& Poco::Dynamic::Var::extract<std::__1::vector<Poco::Dynamic::Var, std::__1::allocator<Poco::Dynamic::Var> > >() const to global weak symbol typeinfo for std::__1::vector<Poco::Dynamic::Var, std::__1::allocator<Poco::Dynamic::Var> > means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in std::__1::vector<Poco::Dynamic::Var, std::__1::allocator<Poco::Dynamic::Var> > const& Poco::Dynamic::Var::extract<std::__1::vector<Poco::Dynamic::Var, std::__1::allocator<Poco::Dynamic::Var> > >() const to global weak symbol typeinfo for std::__1::vector<Poco::Dynamic::Var, std::__1::allocator<Poco::Dynamic::Var> > means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
如果是这样,你确定了导致他们的原因以及解决方法吗?
编辑:根据此主题的其他主题,我已经验证了&#34;默认隐藏的符号&#34;所有项目都设置为YES,包括Poco。
感谢。
答案 0 :(得分:1)
在我的带有多个静态库的iOS项目中,有很多这些警告 - 都是关于对全局弱符号typeinfo的引用。
终于找到了解决方案:
不要将“默认情况下隐藏的符号”设置为YES。将其设置为默认值 - 在“构建设置”中选择相关行,点击删除。对于我的主要iOS可执行文件,似乎解析为“是”,对于静态库,似乎为“否”。
执行此操作后,所有关于直接访问全局弱符号的警告都消失了,我的整个项目似乎都能正常工作。
我希望这有用。