views:

1290

answers:

2

Hi there,

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>        ]
+1  A: 

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.

dirkgently
A: 

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

Try:


configure evc9
crashmstr