0

C++コードをeVC4.0からVisualStudio2008に移植する作業を行っています。ターゲットはWindowsMo​​bile6.1であり、アプリにはWindows Mobile6.0SDKを使用しています。

私たちのコードはeVC4でコンパイルされたときにstlポートを使用しましたが、可能な限りstlポートを引き続き使用したいと思います。

アプリケーションにSTLポート(5.2.1)を組み込むために必要な手順を知っている人はいますか。ソリューションにインクルードディレクトリを設定しましたが(eVC 4.0プロジェクトの場合と同様)、独自のクラスでlist push_backまたはvectorinsertコマンドを使用しようとするとエラー(以下)が発生します(以下はエラーです)。クラス「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>        ]
4

3 に答える 3

1

おそらく表示されるはずのいくつかのリンク (まだ表示されていない場合):

STL ポートに関する注意事項:

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

この投稿にはまだVS2008に移植されていないと書かれていますが。

于 2009-03-02T21:10:11.403 に答える
0

私の場合、これは __PLACEMENT_NEW_INLINE が定義されていたためです

于 2011-01-27T19:52:30.357 に答える
0

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

試す:


configure evc9
于 2009-03-02T21:25:51.193 に答える