• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Xcode vs. Boost
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Xcode vs. Boost


  • Subject: Re: Xcode vs. Boost
  • From: Andreas Grosam <email@hidden>
  • Date: Mon, 06 May 2013 09:03:51 +0200

If you have a Foundation project that includes boost header, you need to ensure that for all translation units all boost headers will be included before any Foundation headers.

Foundation defines a few macros that clash with other names used in boost. For example, boost fusion defines class with name "nil" which conflicts with Objective-C macro nil.

You may achieve this prerequisite through putting all your boost headers before any Foundation header into a Prefix header, e.g.:


// YourProject-Prefix.pch

#ifdef __cplusplus
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/home/phoenix.hpp>
#include <boost/fusion/adapted.hpp>
#include <boost/fusion/algorithm.hpp>
#include <boost/fusion/container.hpp>
#include <boost/fusion/functional.hpp>
#include <boost/fusion/iterator.hpp>
#include <boost/fusion/mpl.hpp>
#include <boost/fusion/sequence.hpp>
#include <boost/fusion/support.hpp>
#include <boost/fusion/tuple.hpp>
#include <boost/fusion/view.hpp>
#endif

#ifdef __OBJC__
    #import <Cocoa/Cocoa.h>
#endif



BTW: you should use most recent boost, since there is a bug somewhere in the internals in spirit/fusion/phoenix - if I remember right until v1.51.0, which occurs when you use clang's standard lib. The fix is easy, but anyway v1.53 compiles without errors.


Andreas



On 05.05.2013, at 17:48, Michael McLaughlin wrote:

> I recently compiled an old project using Xcode 4.6.2 under OS 10.7.5. --> Everything OK.
>
> However, this tool contains
>
> #include "boost/math/special_functions.hpp"
>
> and I updated my Boost installation to 1_50_0 from 1_44_0.  After the update, and after changing "search header paths" accordingly, I got 20 Clang errors, internal to Boost, starting in cons_fwd.hpp.  See arrows below:
>
> #if !defined(BOOST_FUSION_CONS_FWD_HPP_INCLUDED)
> #define BOOST_FUSION_CONS_FWD_HPP_INCLUDED
>
> namespace boost { namespace fusion
> {
>     struct nil;  <-- Declaration of anonymous struct must be a definition
>
>     template <typename Car, typename Cdr = nil> <-- Expected a type
>     struct cons;
> }}
>
> #endif
>
> Xcode is behaving as though Boost itself were broken (which seems unlikely).  Also, no variations on language or dialect seem to matter.
>
> Any thoughts? Workarounds?
>
> Thanks.
>
> --
> Michael McLaughlin
>
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Xcode-users mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Xcode vs. Boost (From: Michael McLaughlin <email@hidden>)

  • Prev by Date: Re: Xcode vs. Boost
  • Next by Date: 'identity and type' inspector - no plain data choice anymore?
  • Previous by thread: Re: Xcode vs. Boost
  • Next by thread: 'identity and type' inspector - no plain data choice anymore?
  • Index(es):
    • Date
    • Thread