2009-03-02 18 views
0

私はeVC 4.0からVisual Studio 2008へのC++コードの移植に取り組んでいます。私たちの目標はWindows Mobile 6.1で、私たちのアプリケーションにWindows Mobile 6.0 SDKを使用しています。VS2008のSTLポートを使用

私たちのコードでは、eVC 4でコンパイルしたときにstlポートを使用していましたが、可能であればstl portを引き続き使用したいと考えています。

アプリケーションにSTLポート(5.2.1)を組み込むために必要な手順を知っている人はいませんか?ソリューションにインクルードディレクトリを設定しましたが(eVC 4.0プロジェクトの場合と同じですが)、独自のクラスでlist push_backまたはvector insertコマンドを使用しようとすると、エラーが発生します(下記参照)。私たちのクラス "TriangleBufferElement"で)。これらのコマンドは、int、doubleなどのネイティブ型で動作するように見えます。

すべてのクラスに適切なコンストラクタ、コピーコンストラクタ、代入演算子、および比較演算子があり、すべて正しいものであることが保証されています。

アイデア?

C:\Program Files\Windows CE Tools\stlport\stl/_construct.h(119) : error C2665: 'operator new' : none of the 2 overloads could convert all the argument types 
1>  C:\Program Files\Windows Mobile 6 SDK\PocketPC\include\../../../Windows Mobile 6 SDK\PocketPC\Include\Armv4i/new(61): could be 'void *operator new(unsigned int,const std::nothrow_t &) throw()' 
1>  while trying to match the argument list '(unsigned int, TriangleBufferElement *)' 
1>  C:\Program Files\Windows CE Tools\stlport\stl/_construct.h(134) : see reference to function template instantiation 'void stlp_std::_Copy_Construct_aux<_Tp>(_Tp *,const _Tp &,const stlp_std::__false_type &)' being compiled 
1>  with 
1>  [ 
1>   _Tp=TriangleBufferElement 
1>  ] 
1>  C:\Program Files\Windows CE Tools\stlport\stl/_vector.h(381) : see reference to function template instantiation 'void stlp_std::_Copy_Construct<_Tp>(_Tp *,const _Tp &)' being compiled 
1>  with 
1>  [ 
1>   _Tp=TriangleBufferElement 
1>  ] 
1>  C:\Program Files\Windows CE Tools\stlport\stl/_vector.h(376) : while compiling class template member function 'void stlp_std::vector<_Tp>::push_back(const _Tp &)' 
1>  with 
1>  [ 
1>   _Tp=TriangleBufferElement 
1>  ] 
1>  c:\srcdevbranch\pointlib\dtmconverter\dtm\dtmreader\.\trianglebuffer.h(47) : see reference to class template instantiation 'stlp_std::vector<_Tp>' being compiled 
1>  with 
1>  [ 
1>   _Tp=TriangleBufferElement 
1>  ] 
+0

を定義したのか? –

+0

はい、エラーを回避するためにpre/codeタグを使用してください。 – crashmstr

答えて

1

(まだ見ていない場合)あなたはおそらく見るべきいくつかのリンク:デフォルトSGIのノードアロケータと問題が発生する可能性があり

STLPort Notes:

。私はそのような問題はなかった。デフォルトのノードアロケータはかなり高速ですので、重大な理由なしに無効にすることはお勧めしません。ただし、問題が発生した場合は、_STLP_USE_MALLOCまたは_STLP_USE_NEWALLOCと定義して、裸のmalloc()ベースまたはnew()ベースのデフォルトアロケータを取得してください。

this投稿はまだVS2008に移植されていません。

0

新しいコンパイラ環境用にSTLPortを再構成しましたか? Visual Studio 2008は、古いeVC++コンパイラとはかなり異なっています。

試してみてください。私の場合は


configure evc9 
0

、これは__PLACEMENT_NEW_INLINEによるこのエラー線を中心にサンプルコードを追加することができ

関連する問題