缺少C ++标头< __ debug>更新OSX命令行工具6.3 [英] Missing C++ header <__debug> after updating OSX Command Line Tools 6.3

查看:311
本文介绍了缺少C ++标头< __ debug>更新OSX命令行工具6.3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从App Store更新到命令行工具6.3后,包括< vector> < iterator> 其中内部包括< __ debug>将导致文件未找到错误如下。

  c ++ -O3 -I / Users / farleylai / Documents / dev / git / ESMS / Optimizer /../ StreamIt / build / binaries / clusterStaticLibrary / Users / farleylai /文件/ dev / git / ESMS / Optimizer / build / StreamIt / FIR / 511/512 / combined_threads.cpp -o streamit -lcluster -lpthread -lstdc ++ 
在/ Users / farleylai / Documents / dev / git /ESMS/Optimizer/build/StreamIt/FIR/511/512/combined_threads.cpp:9:
在/Users/farleylai/Documents/dev/git/ESMS/Optimizer/../StreamIt/src中包含的文件/cluster/headers/node_server.h:22:
在/Users/farleylai/Documents/dev/git/ESMS/Optimizer/../StreamIt/src/cluster/headers/thread_info.h:20中包含的文件中:
在/Users/farleylai/Documents/dev/git/ESMS/Optimizer/../StreamIt/src/cluster/headers/connection_info.h:19中包含的文件中:
/ Users / farleylai /文件/ dev / git / ESMS / Optimizer /../ StreamIt / src / cluster / headers / socket_holder.h:43:25:warning:delete对'mysocket'是抽象的,但是有非虚构的析构函数
[-wdelete-non-virtual-dtor]
if(!is_mem_socket)delete sock;
^
在/Users/farleylai/Documents/dev/git/ESMS/Optimizer/build/StreamIt/FIR/511/512/combined_threads.cpp:9中包含的文件中:
在文件中包含自/Users/farleylai/Documents/dev/git/ESMS/Optimizer/../StreamIt/src/cluster/headers/node_server.h:22:
在/ Users / farleylai / Documents / dev中包含的文件中/git/ESMS/Optimizer/../StreamIt/src/cluster/headers/thread_info.h:26:
在/Library/Developer/CommandLineTools/usr/bin/../include/c++/包含的文件中v1 / vector:265:
在/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/__bit_reference:15:
中包含的文件/ Library / Developer / CommandLineTools / usr /bin/../include/c++/v1/algorithm:641:10:致命错误:'__debug'文件未找到
#include< __ debug>
^

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



谢谢。



MacBook Pro on OSX 10.10.3



更新:



由苹果在他们的开发者论坛。在命令行工具6.2中,包含__debug的条件保护如下,但不在6.3中。

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

和libcxx人谈到删除__debug的守卫此处

解决方案

将命令行工具降级到 6.2 via < a href =https://developer.apple.com/downloads/index.action#> Apple的开发人员下载页面。



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




  • OS X 10.10 commandlinetoolsosx10.10forxcode6。 2.dmg

  • OS 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. 如果手动添加文件,您必须稍后删除,
  4. > Apple修正问题已修复
    安装命令行工具 6.3.1 后,一切正常工作!


    After updating to Command Line Tools 6.3 from the App Store, programs including <vector> or <iterator> which internally include <__debug> will cause file not found error as follows. The cpp is nothing interesting but includes in one of the included headers.

    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>
             ^
    

    Any ideas to fix this? I don't expect to specify any additional C++ flags.

    Thanks.

    PS: MacBook pro on OSX 10.10.3

    Updates:

    The issue is verified by Apple on their developer's forum. In Command Line Tools 6.2, the inclusion of __debug is conditionally guarded as follows but not in 6.3.

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

    And libcxx people talked about removing the guards of __debug here. It feels like __debug never exists on OSX.

    解决方案

    Downgrade the Command Line Tools to 6.2 via Apple's Developer Download Page.

    Be careful to download the correct version for your OS X:

    • OS X 10.10 commandlinetoolsosx10.10forxcode6.2.dmg
    • OS X 10.9 commandlinetoolsosx10.9forxcode6.2.dmg

    This works because the inclusion of __debug is conditionally guarded as follows in Command Line Tools 6.2 but not in 6.3.

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

    In my opinion this is the safest way, because:

    1. You don't compromise your toolchain
    2. You can easily upgrade via the App Store when Apple fixes the issue
    3. If you add a file manually you have to delete it later or more problems could occur

    Update - 21.04.2015

    Problem fixed by Apple. After installing Command Line Tools 6.3.1 everything works as expected!

    这篇关于缺少C ++标头&lt; __ debug&gt;更新OSX命令行工具6.3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆