更新 OSX 命令行工具 6.3 后缺少 C++ 标头 <__debug>

2024-05-25

从 App Store 更新到 Command Line Tools 6.3 后,程序包括<vector> or <iterator>内部包含 <__debug> 将导致文件未找到错误,如下所示。该 cpp 没什么有趣的,但包含在包含的标头之一中。

c++ -O3 -I/Users/farleylai/Documents/dev/git/ESMS/Optimizer/../StreamIt/src/cluster/headers -L/Users/farleylai/Documents/dev/git/ESMS/Optimizer/../StreamIt/build/binaries/clusterStaticLibrary /Users/farleylai/Documents/dev/git/ESMS/Optimizer/build/StreamIt/FIR/511/512/combined_threads.cpp -o streamit -lcluster -lpthread -lstdc++
In file included from /Users/farleylai/Documents/dev/git/ESMS/Optimizer/build/StreamIt/FIR/511/512/combined_threads.cpp:9:
In file included from /Users/farleylai/Documents/dev/git/ESMS/Optimizer/../StreamIt/src/cluster/headers/node_server.h:22:
In file included from /Users/farleylai/Documents/dev/git/ESMS/Optimizer/../StreamIt/src/cluster/headers/thread_info.h:20:
In file included from /Users/farleylai/Documents/dev/git/ESMS/Optimizer/../StreamIt/src/cluster/headers/connection_info.h:19:
/Users/farleylai/Documents/dev/git/ESMS/Optimizer/../StreamIt/src/cluster/headers/socket_holder.h:43:25: warning: delete called on 'mysocket' that is abstract but has non-virtual destructor
      [-Wdelete-non-virtual-dtor]
    if (!is_mem_socket) delete sock;
                        ^
In file included from /Users/farleylai/Documents/dev/git/ESMS/Optimizer/build/StreamIt/FIR/511/512/combined_threads.cpp:9:
In file included from /Users/farleylai/Documents/dev/git/ESMS/Optimizer/../StreamIt/src/cluster/headers/node_server.h:22:
In file included from /Users/farleylai/Documents/dev/git/ESMS/Optimizer/../StreamIt/src/cluster/headers/thread_info.h:26:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/vector:265:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/__bit_reference:15:
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/algorithm:641:10: fatal error: '__debug' file not found
#include <__debug>
         ^

有什么想法可以解决这个问题吗? 我不希望指定任何额外的 C++ 标志。

Thanks.

PS:OSX 10.10.3 上的 MacBook Pro

Updates:

Apple 在其开发者论坛上验证了该问题。在命令行工具 6.2 中,__debug 的包含受到如下条件保护,但在 6.3 中则不然。

#ifdef _LIBCPP_DEBUG
#   include <__debug>
#else
#   define _LIBCPP_ASSERT(x, m) ((void)0)
#endif

libcxx 人们谈论移除 __debug 的守卫here http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140804/112292.html。感觉 __debug 在 OSX 上从来不存在。


将命令行工具降级为6.2 via Apple 的开发者下载页面 https://developer.apple.com/downloads/index.action#.

请小心下载适合您的 OS X 的正确版本:

  • 操作系统 X 10.10 commandlinetoolsosx10.10forxcode6.2.dmg
  • 操作系统 X 10.9 commandlinetoolsosx10.9forxcode6.2.dmg

这是有效的,因为包含__debug在命令行工具 6.2 中按如下方式有条件保护,但在 6.3 中则不然。

#ifdef _LIBCPP_DEBUG
#   include <__debug>
#else
#   define _LIBCPP_ASSERT(x, m) ((void)0)
#endif

我认为这是最安全的方法,因为:

  1. 您不会损害您的工具链
  2. 当 Apple 修复问题后,您可以通过 App Store 轻松升级
  3. 如果您手动添加文件,则必须稍后将其删除,否则可能会出现更多问题

更新 - 21.04.2015

问题已解决由苹果公司。 安装命令行工具后6.3.1一切都按预期进行!

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

更新 OSX 命令行工具 6.3 后缺少 C++ 标头 <__debug> 的相关文章

随机推荐