Linux上にビルドされた既存の製品があり、Mac OSに移植しようとしています。TR1を使用してMac OSでC++をコンパイルする方法
[email protected]:~$ xcode-select -v
xcode-select version 2343.
[email protected]:~$ g++ -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.29)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
問題は、それがTR1 /タプルライブラリを使用しており、何らかの理由で、デフォルトではありません パスが含まれていることです。
[email protected]:~$ ls /usr/include/c++/4.2.1/tr1/tuple
/usr/include/c++/4.2.1/tr1/tuple
だからそれは、上記 GXX --with-含ま-dirオプションに基づいて、インクルードパスにまだ
そして
[email protected]:~$ cat hello.cpp
#include <iostream>
#include <tr1/tuple>
using namespace std;
int main(void) {
cout << "Hello, World!" << endl;
return 0;
}
[email protected]:~$ g++ -o hello hello.cpp
hello.cpp:2:10: fatal error: 'tr1/tuple' file not found
#include <tr1/tuple>
^
1 error generated.
なぜdoesnのであるべき、がありますこれはちょうど仕事ですか?
ありがとうございました。
ここで説明するドキュメントはどこですか?私は何も明らかに見つけることができませんでしたが、私はそれを逃した可能性があります。 –
残念ながら、状況を説明しているAppleのドキュメントは見つかりません。 libC++が最初に含まれていたとき(10.7)、おそらくデフォルト(10.9?)になったときにリリースノートに記載されていたと思います。この 'tr1'の違いは、両者の最大の非互換性です。 –
-stdlib = libstdC++でclag ++を呼び出す方法は?申し訳ありません、私は初心者です – Apoorv