在VS2008中使用STL端口

发布于 2024-07-14 00:37:49 字数 2154 浏览 6 评论 0原文

我正在致力于将我们的 C++ 代码从 eVC 4.0 移植到 Visual Studio 2008。我们的目标是 Windows Mobile 6.1,并且我们正在为我们的应用程序使用 Windows Mobile 6.0 SDK。

我们的代码在 eVC 4 中编译时使用了 stl 端口,如果可能的话,我们希望继续使用 stl 端口。

有谁知道将 STL 端口 (5.2.1) 合并到我们的应用程序中需要执行哪些步骤。 我们已经在解决方案中设置了包含目录(就像我们对 eVC 4.0 项目所做的那样),但是每当我们尝试对我们自己的类使用 list Push_back 或向量插入命令时,我们都会看到错误(下面是错误)与我们的类“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>        ]

I am working on porting our C++ code from eVC 4.0 to Visual Studio 2008. Our target is Windows Mobile 6.1 and we are using the Windows Mobile 6.0 SDK for our app.

Our code used stl port when compiled in eVC 4 and we would like to continue to use stl port if at all possible.

Does anyone know what steps are necessary to incorporate STL port (5.2.1) in our application. We have set the include directories in the solution (as we did for the eVC 4.0 project), but we are seeing the errors (below) any time we try to use list push_back or vector insert commands with our own classes (below is the error with our class "TriangleBufferElement"). These commands do seem to work with native types like int, double, etc.

We have ensured all classes have the proper contructors, copy constructors, assignment operators, and comparison operators and all appear to be correct.

Any ideas?

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>        ]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

美羊羊 2024-07-21 00:37:50

您可能应该看到的一些链接(如果尚未看到):

STLPort 注释:

您可能会遇到默认 SGI 节点分配器的问题。 不过,我没有这样的问题。 默认节点分配器非常快,因此我不建议在没有严重原因的情况下禁用它。 但是,如果它导致问题,请定义 _STLP_USE_MALLOC_STLP_USE_NEWALLOC 以获得基于 malloc() 的裸露或 new() > 基于默认分配器。

虽然 这篇文章说它还没有移植到VS2008。

Some links you probably should see (if not seen already):

STLPort Notes:

You may experience problems with default SGI node allocator. I had no such problems, though. Default node allocator is quite fast, so I wouldn't recommend disabling it without serious reason. However, if it causes problems, define _STLP_USE_MALLOC or _STLP_USE_NEWALLOC to get bare malloc()-based or new()-based default allocator.

Though this post says it has not yet been ported to VS2008.

谜泪 2024-07-21 00:37:50

您是否为新的编译器环境重新配置了 STLPort? Visual Studio 2008 与旧的 eVC++ 编译器有很大不同。

尝试:


configure evc9

Have you reconfigured STLPort for the new compiler environment? Visual Studio 2008 is quite different from the old eVC++ compiler.

Try:


configure evc9
漫漫岁月 2024-07-21 00:37:50

就我而言,这是由于 __PLACMENT_NEW_INLINE 定义的

In my case, this was due to __PLACEMENT_NEW_INLINE defined

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文