Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7413619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:56:09+00:00 2026-05-29T06:56:09+00:00

I’ve been using Boost as a framework built from Pete Goodliffe’s script for quite

  • 0

I’ve been using Boost as a framework built from Pete Goodliffe’s script for quite some time. Works great. Recently I have hit a problem that can be reproduced by dropping the following code into the viewDidLoad of a view controller in an otherwise brand new XCode project:

#include "boost/filesystem/path.hpp"
#include "boost/filesystem/operations.hpp"


- (void)viewDidLoad
{
    [super viewDidLoad];
    boost::filesystem::path path("/var/mobile/Applications/.../Documents/somefile.txt");
    bool b = boost::filesystem::exists(path);
}

This results in EXC_BAD_ACCESS when the path object is destroyed (the problem occurs in the destructor of the basic_string member of path). Has anyone else run into this problem? Everything is built with the same SDK and visibility settings are the same on test project and framework. Inside ::exists, the only function called on path is .c_str(), which I can call in my code with no problem. It passes the result of .c_str() to ::stat, which I can also call successfully. It seems like a runtime mismatch of some sort. Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T06:56:10+00:00Added an answer on May 29, 2026 at 6:56 am

    Pete Goodliffe’s script builds boost using gcc, which in the current SDK is llvm-gcc. The Boost.Build system detects gcc and enables a set of visibility macros for certain things, notably some of the exception macros used by the filesystem library when GCC is in use. By default, iOS applications built using the current SDK will use clang. The boost configuration headers also detect clang when it’s in use, and these visibility macros are not configured the same way. This leads to some linker warnings when you use clang to build your application against boost but use a boost library built with gcc, e.g. about vtable and destructor visibility for the exception classes in question. When your string gets passed into one of these classes, as is likely to happen when you call filesystem::exists() you see a crash in the destructor.

    For this specific example, you could remedy the problem by building boost with visibility=default, but that’s unlikely to work well for non-trivial applications. So far, it looks like the best bet is to set the compiler to clang++ so that you have the same visibility settings in effect for these classes when you build the library as you do when you build your application. Here’s the user-config.jam I’m currently using with (my modified version of) that script and Xcode 4.2.x. Note that you’ll need to replace $IPHONE_SDKVERSION, ARM_DEV_DIR and SIM_DEV_DIR if you’re not setting those up in your script. For me, they’re 5.0 and the bin directories of the iphone and simulator SDKs, respectively:

    using darwin : $IPHONE_SDKVERSION~iphone
       : ${ARM_DEV_DIR}clang++
       : <striper>
       <compileflags>"-arch armv7 -fvisibility=hidden -fvisibility-inlines-hidden $EXTRA_CPPFLAGS"
       : <architecture>arm <target-os>iphone
       ;
    using darwin : $IPHONE_SDKVERSION~iphonesim
       : ${SIM_DEV_DIR}clang++
       : <striper>
       <compileflags>"-arch i386 -fvisibility=hidden -fvisibility-inlines-hidden $EXTRA_CPPFLAGS"
       : <architecture>x86 <target-os>iphone
       ;
    

    So far, that seems to be working well; I’ve not tested enough to completely assure myself there are no clang-related problems with boost, but this looks easier than taking new iPhone projects back to llvm-gcc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.