Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
140 views
in Technique[技术] by (71.8m points)

c++ - xcode with boost : linker(Id) Warning about visibility settings

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

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

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?

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?

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

If boost is included by multiple projects, each project must have the same values for

 Symbols Hidden by Default
 Inline Methods Hidden

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...