奇怪的Xcode链接器警告构建Poco c++应用程序



有没有人在用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.

如果有,你是否确定是什么原因导致的以及如何解决它们?

编辑:根据这个主题的其他线程,我已经验证了"默认隐藏符号"在所有项目上设置为YES,包括Poco。

谢谢。

在我的多个静态库的iOS项目中,有很多这样的警告——都是关于引用全局弱符号typeinfo的。

终于找到了解决办法:

不要将"Symbols hidden by default"设置为YES。将其设置为默认值-在"构建设置"中选择相关行,点击删除。在这里,它似乎解决了我的主要iOS可执行文件的"是"和静态库的"否"。

这样做之后,所有关于直接访问全局弱符号的警告都消失了,我的整个项目似乎正常工作。

最新更新