簡體   English   中英

在VS2008中使用STL端口

[英]Using STL port in VS2008

我正在將c ++代碼從eVC 4.0移植到Visual Studio2008。我們的目標是Windows Mobile 6.1,我們正在為應用程序使用Windows Mobile 6.0 SDK。

在eVC 4中編譯時,我們的代碼使用了stl端口,並且我們希望盡可能繼續使用stl端口。

有誰知道將STL端口(5.2.1)納入我們的應用程序所需的步驟。 我們已經在解決方案中設置了include目錄(就像在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>        ]

您可能應該看到的一些鏈接(如果尚未看到):

STLPort注意:

您可能會遇到默認SGI節點分配器的問題。 我沒有這樣的問題。 默認的節點分配器非常快,因此我不建議在沒有嚴重理由的情況下禁用它。 但是,如果它引起問題,請定義_STLP_USE_MALLOC_STLP_USE_NEWALLOC以獲取基於裸malloc()或基於new()的默認分配器。

雖然這篇文章說它還沒有移植到VS2008。

就我而言,這是由於定義了__PLACEMENT_NEW_INLINE

您是否已為新的編譯器環境重新配置了STLPort? Visual Studio 2008與舊的eVC ++編譯器完全不同。

嘗試:


configure evc9

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM