如何强制xcode使用正确的iostream标头c

如何强制xcode使用正确的iostream标头c,第1张

概述xcode 4.2os x 10.7 当我设置我的包括看起来像: #include <iostream>#include <boost/thread.hpp> 我从位于/ opt / local / include / boost / tr1 / tr1的文件中收到以下错误 Lexical or Preprocessor Issue'boost/tr1/detail/config_all.h
xcode 4.2os x 10.7

当我设置我的包括看起来像:

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

我从位于/ opt / local / include / boost / tr1 / tr1的文件中收到以下错误

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

/ 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 @R_404_6852@//  liCENSE_1_0.txt or copy at http://www.boost.org/liCENSE_1_0.txt)////  This @R_404_6852@ 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

我应该使用位于/Developer/SDKs/MacOSX10.7.sdk/usr/include/c /4.2.1/的iostream标头

你将不得不原谅我,因为我对c很新,甚至更新xcode.预先感谢您的任何帮助.

解决方法 绝对关闭递归搜索.如果没有指定完整的提升路径,您永远不能包含boost标头.很多Boost都是最终会成为标准的功能的训练基础,因此有很多Boost标题与标准标题共享同一个名称.还有一堆与其他boost标题共享同一名称的boost标头.这将导致你的悲伤无止境. 总结

以上是内存溢出为你收集整理的如何强制xcode使用正确的iostream标头c全部内容,希望文章能够帮你解决如何强制xcode使用正确的iostream标头c所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1007336.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-22
下一篇 2022-05-22

发表评论

登录后才能评论

评论列表(0条)

保存