xcode with boost:linker(Id) 关于可见性设置的警告

2023-06-30C/C++开发问题
6

本文介绍了xcode with boost:linker(Id) 关于可见性设置的警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我一直在为我的 iPhone Xcode 项目使用以下链接中的 boost 框架:https://goodliffe.blogspot.com/2010/09/building-boost-framework-for-ios-iphone.html

I have been using a boost framework from the link below for my iPhone Xcode project: https://goodliffe.blogspot.com/2010/09/building-boost-framework-for-ios-iphone.html

它工作正常,但我总是收到数百个 Apple Mach-O Linker(id) 警告,例如:

it works fine but I always get hundreds of Apple Mach-O Linker(id) Warnings like:

在 __ZN5boost15program_options6detail7cmdline24handle_additional_parserERSt6vectorISsSaISsEE 中直接访问全局弱符号 __ZTVN5boost17bad_function_callE 意味着不能在运行时覆盖弱符号.这可能是由于使用不同的可见性设置编译不同的翻译单元所致.

Direct access in __ZN5boost15program_options6detail7cmdline24handle_additional_parserERSt6vectorISsSaISsEE to global weak symbol __ZTVN5boost17bad_function_callE means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.

如何去掉代码中的那些警告?

How to get rid of those warnings in code?

通过设置默认隐藏符号 = YES,我设法摆脱了大部分警告,但还有3个不会消失,谁能告诉我为什么?

edited: By set Symbols Hidden by Default = YES, I managed to get rid of most of the warnings but there are 3 more left which won't go away, can anyone tell me why?

再次重建后,剩余的 3 个警告也消失了!所以我的解决方案确实有效!

edited again: After a rebuild the remaining 3 warning are gone as well! So my solution did work!

推荐答案

Doe 刚刚想出了如何摆脱数百个这样的警告:为整个目标或项目设置默认隐藏符号构建设置为YES

Doe just figured how to get rid of hundreds of warning like this : set for an entire target or project with the Symbols Hidden by Default build setting to YES

这篇关于xcode with boost:linker(Id) 关于可见性设置的警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

无法访问 C++ std::set 中对象的非常量成员函数
Unable to access non-const member functions of objects in C++ std::set(无法访问 C++ std::set 中对象的非常量成员函数)...
2024-08-14 C/C++开发问题
17

从 lambda 构造 std::function 参数
Constructing std::function argument from lambda(从 lambda 构造 std::function 参数)...
2024-08-14 C/C++开发问题
25

STL BigInt 类实现
STL BigInt class implementation(STL BigInt 类实现)...
2024-08-14 C/C++开发问题
3

使用 std::atomic 和 std::condition_variable 同步不可靠
Sync is unreliable using std::atomic and std::condition_variable(使用 std::atomic 和 std::condition_variable 同步不可靠)...
2024-08-14 C/C++开发问题
17

在 STL 中将列表元素移动到末尾
Move list element to the end in STL(在 STL 中将列表元素移动到末尾)...
2024-08-14 C/C++开发问题
9

为什么禁止对存储在 STL 容器中的类重载 operator&()?
Why is overloading operatoramp;() prohibited for classes stored in STL containers?(为什么禁止对存储在 STL 容器中的类重载 operatoramp;()?)...
2024-08-14 C/C++开发问题
6