奇怪的Xcode链接器警告构建Poco c++应用程序
Strange Xcode linker warning building Poco C++ app
有没有人在用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可执行文件的"是"和静态库的"否"。
这样做之后,所有关于直接访问全局弱符号的警告都消失了,我的整个项目似乎正常工作。
相关文章:
- C++为构建时间获取QDateTime的可靠方法
- 无法在 CLion 中构建 C++ 项目
- 函数向量_指针有不同的原型,我可以构建一个吗
- 如何使用ndk-build.cmd构建Android.so文件
- POCO::PostgreSQL:如何将std::vector支持添加到`Binder::bind`
- libssh 的函数在构建 libssh 时无法在 Qt 和 cmake 错误中找到
- 使用cmake从源代码构建MySQL连接器/C++失败(与以前的声明冲突)
- Windows 套接字和身份验证构建在包含 Poco-Library 时失败
- 使用加密模块构建 Poco 1.9.0
- 用于构建 POCO 库的 mysql 连接器
- 如何构建 Poco C++库
- 关于在C++express下构建POCO的具体说明
- 使用gcc构建poco时,Recipe失败
- 使用poco库构建HTTPS服务器时出错
- osx - 构建 POCO 库时出现链接错误
- C++ POCO 构建错误
- 在Windows中使用CMake构建POCO库
- Poco c++ Crypto静态库在XCode构建时会产生错误
- 使用自定义链接标志构建poco库
- 奇怪的Xcode链接器警告构建Poco c++应用程序