How to get xcode to use the correct iostream C ++ header

xcode 4.2 os x 10.7 

when I install my include, it looks like this:

 #include <iostream> #include <boost/thread.hpp> 

I get the following error from a file located in /opt/local/include/boost/tr1/tr1

 Lexical or Preprocessor Issue 'boost/tr1/detail/config_all.hpp' file not found 

The contents of the file /opt/local/include/boost/tr1/tr1/iostream :

 // (C) Copyright John Maddock 2005. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // // This file exists to prevent std lib headers from accidentally // including a TR1 extention header; we must suppress this otherwise // we can end up with cyclic dependencies with some std lib implementations. // #ifndef BOOST_TR1_iostream_INCLUDED # define BOOST_TR1_iostream_INCLUDED # ifndef BOOST_TR1_NO_RECURSION # define BOOST_TR1_NO_RECURSION # define BOOST_TR1_NO_iostream_RECURSION # endif # include <boost/tr1/detail/config_all.hpp> # if defined(BOOST_HAS_INCLUDE_NEXT) && !defined(BOOST_TR1_DISABLE_INCLUDE_NEXT) # include_next <iostream> # else # include BOOST_TR1_STD_HEADER(iostream) # endif # ifdef BOOST_TR1_NO_iostream_RECURSION # undef BOOST_TR1_NO_iostream_RECURSION # undef BOOST_TR1_NO_RECURSION # endif #endif 

I should use the iostream header located at /Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1/

You will have to forgive me, as I am very new to C ++ and even newer to xcode. Thanks in advance for any help.

+4
source share
1 answer

Definitely disable recursive search. You should never include a boost header without specifying the full boost path. Most Boost is a training ground for features that ultimately contribute to the standard, and so there are a large number of Boost headers that have the same name as standard headers. There are also a bunch of formatting headers that have the same name as other forwards headers. There is no end to this grief, it will challenge you.

+3
source

Source: https://habr.com/ru/post/1387829/


All Articles