2012-03-28 4 views
0

のSTLを使用すると、うまくいけば、これは私が拡張現実のプロジェクトのためにARToolkitを使用しています、そしてそれは、Macの下で働くようにするために私がする必要がある...マック10.5 SDK内

mac.stackexchangeよりStackOverflowのより関連性があります10.5 SDKを実行します。

私の問題は、私がSTLヘッダーファイル、特にベクトルを含めるように見えないことです。

使用できるラッパーや回避策はありますか?私は基本的にストレートCコードをコンパイルしていますし、開発をスピードアップするためにSTLフレームワークのよりよい機能の一部を利用したいと思い...


編集:

精密検査では、それが表示されますそのARToolkitはインクルードパスのある時点でstd_vectorをインクルードしています。

エラースニペット:

Bits/c++allocator.h: No such file or directory 
Expected template-name before '<' token 
Expected `{' before '<' token 
Expected unqualified-id before '<' token 
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.2.1/iosfwd 
Bits/c++locale.h: No such file or directory 
Bits/c++io.h: No such file or directory 
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h 
Bits/c++config.h: No such file or directory 
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.2.1/bits/stl_vector.h 
Expected type-specifier before 'allocator' 
Expected '>' before 'allocator' 
'input_iterator_tag' has not been declared 
'forward_iterator_tag' has not been declared 
'input_iterator_tag' has not been declared 
'forward_iterator_tag' has not been declared 
'input_iterator_tag' has not been declared 
'forward_iterator_tag' has not been declared 
There are no arguments to '__N' that depend on a template parameter, so a declaration of '__N' must be available 
(if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) 
Expected nested-name-specifier before 'iterator_traits' 
Expected initializer before '<' token 
There are no arguments to '_IterCategory' that depend on a template parameter, so a declaration of '_IterCategory' must be available 
Expected nested-name-specifier before 'iterator_traits' 
Expected initializer before '<' token 
There are no arguments to '_IterCategory' that depend on a template parameter, so a declaration of '_IterCategory' must be available 
Expected nested-name-specifier before 'iterator_traits' 
Expected initializer before '<' token 
There are no arguments to '_IterCategory' that depend on a template parameter, so a declaration of '_IterCategory' must be available 
/Users/espais/research/artoolkit/trunk/artoolkit/examples/newproject/newproject.cpp 
Expected `}' at end of input 
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.2.1/bits/stl_bvector.h 
Expected template-name before '<' token 
Expected `{' before '<' token 
Expected unqualified-id before '<' token 
+0

なぜSTLヘッダーファイルを含めることができませんか?あなたは何をしますか? –

+1

STLはC++標準ライブラリの一部です。あなたがコンパイルしているものが「基本的にまっすぐなCコード」なら、おそらくそれはあなたの問題かもしれません。 ;) – jalf

+0

True ...私は何とかコンパイラをC++に切り替えることを望んでいました(現在のところ、オプションはLLVM GCC 4.2とApple LLVMコンパイラ3.0です)。 – espais

答えて

0

基本的に、舞台裏でやる必要のあるトリッキーがありました。 私は自分のローカルSDKを更新しなければなりませんでした(ARToolkitは新しいバージョンをサポートしていますが、ドキュメントの記述にかかわらず)、STLライブラリが動作しました。

0

あなたはあなたのファイルの代わりに.m(のObjective-C)の.mmファイル(のObjective-C++)を作成する必要がある場合があります。

それ以外は、#include <vector>を実行しても問題ありません。

+0

実際には.Cファイルです。私はコンパイラをC++に切り替えることを望んでいましたが、表示されるのはgccだけです。 – espais

+0

プロジェクトのビルド設定に入り、GCC 4.2言語セクションの下で、「ファイルの種類に応じて」ではなく「ソースをコンパイルする」の下にある「C++」を選択します。 – StilesCrisis

+0

これはうまくいきますが、ベクターヘッダをインクルードすると、エラーが200を超えてしまいます... – espais