web-dev-qa-db-ja.com

OSXコマンドラインツール6.3の更新後、C ++ヘッダー<__ debug>が見つかりません

App StoreからCommand Line Tools 6.3に更新した後、<vector>または<iterator>内部に<__ debug>を含めると、次のようなファイルが見つからないというエラーが発生します。 cppは興味深いものではありませんが、含まれているヘッダーの1つに含まれています。

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++フラグを指定する予定はありません。

ありがとう。

PS:OSX 10.10.3上のMacBook pro

更新:

この問題は、開発者のフォーラムのAppleで検証されています。コマンドラインツール6.2では、__ debugの包含は次のように条件付きで保護されていますが、6.3では保護されていません。

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

また、libcxxの人々は__debug here のガードを削除することについて話しました。 __debugはOSXには決して存在しないように感じます。

66
Farley

Appleの開発者向けダウンロードページ を使用して、コマンドラインツールを6.2にダウングレードします。

OS Xの正しいバージョンをダウンロードするように注意してください:

  • OS X 10.10commandlinetoolsosx10.10forxcode6.2.dmg
  • OS X 10.9commandlinetoolsosx10.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

Appleによる問題の修正。コマンドラインツール6.3.1をインストールした後、すべてが期待どおりに動作します!

60
gismo141

不足している__debugファイルを一時的に作成します。_LIBCPP_ASSERTは、OS Xのコマンドラインツール6.2のように定義されます。

echo '#define _LIBCPP_ASSERT(x, m) ((void)0)' | Sudo tee -a /Library/Developer/CommandLineTools/usr/include/c++/v1/__debug > /dev/null

ビルドが完了したら、一時ファイルを削除します。

Sudo rm /Library/Developer/CommandLineTools/usr/include/c++/v1/__debug
38
jwu

警告!!!これはハックです、自己責任で使用してください!!!この回避策は、temporaryAppleがコマンドラインツールのアップデートを提供するまで修正。

OK、ここに行きます:自分でファイルを作成し、次のコンテンツを入れます:

#ifndef _LIBCPP_ASSERT
#define _LIBCPP_ASSERT(...) ((void)0)
#endif

これは私には役立つようですが、それは確かに正しいことではありません。ファイルが正しい場所にあることを確認してください/Library/Developer/CommandLineTools/usr/include/c++/v1/__debug正しい所有者/権限を持つ。

9
Daniel Frey

これは https://developer.Apple.com/downloads から入手できるCommand Line Tools 6.3.1で修正されました。更新はApp Storeの更新に自動的に表示されます(ただし、6.3.1ではなく6.3とラベル付けされています)。ご不便をおかけして申し訳ございません。問題をご報告いただきありがとうございます。

以前:単純なケースで私のために働いた回避策は、「-mmacosx-version-min = 10.8」でOS X 10.8以前の最小値を設定することでした。

6
Flash Sheridan

@Flash Sheridanのアドバイスに従い、CLTを再度動作させました(git、Ruby、brew ...)-「Xcode 6.3.1のコマンドラインツール(OS X 10.10)」を使用しました。

1
zstolar