Solved

Windows CE STL problems

Posted on 2003-11-29
7
481 Views
Last Modified: 2013-12-14
I have read that windows CE supports the STL library however when I attempt to use components from the STL library such as

<map> or <vector> I get the following error

c:\program files\windows ce tools\wce420\pocket pc 2003\include\armv4\xmemory(46) : error C2660: 'new' : function does not take 2 parameters
        c:\program files\windows ce tools\wce420\pocket pc 2003\include\armv4\xmemory(78) : see reference to function template instantiation 'void __cdecl std::_Construct(unsigned int *,const unsigned int &)' being compiled

I have tried starting new projects and just adding in the header files and assigning some memory to a std::map but it still gives me that error.

I have also tried switching from debug to release version of the compiler and I still recieve the same error.

The only time I have been able to get rid of the error is to turn off precompiled headers and move the include declaration for <map> or <vector> above that of the "stdafx.h".

The development environment being used for this is the embedded c++ 4 with service pack 2 and the SDK for pocket pc 2003 installed.

Any help on this problem would be apprecaiated.
0
Comment
Question by:bsochan
7 Comments
 
LVL 30

Expert Comment

by:Axter
ID: 9844989
It sounds like the #include's are listed in the wrong order.

Please post all the #include's you have for the implementation that's giving you the error.

Also give information on any #include directives that you have in your project's header files.
0
 

Author Comment

by:bsochan
ID: 9848884
An example would be

in the file

programfiledlg.cpp the includes would be as follows. It is setup as the headers would be in a new project that has just been started.

#include "stdafx.h"

#include "programfiledlg.h"

..... program code follows

the header file would have something like

#include <map>
#include <vector>
#include <string>

this is then followed by any header files that are then needed from with the projects existing structure.
0
 
LVL 30

Expert Comment

by:Axter
ID: 9849231
>>this is then followed by any header files that are then needed from with the projects existing structure.

Can you post the header files listed in the project header files?

More then likely, there are header files in the project header files that are creating the conflict.

This is one of the reasons header files should only have the bare minimum #include directives.

The problem is probably nested in one of your #include's of #include's
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 30

Expert Comment

by:Axter
ID: 9849237
Do you have "using namespace std" in any of your header files?
This could also cause problems if non-standard headers are mixed with standard headers.
0
 

Author Comment

by:bsochan
ID: 9854830
We have actually managed to work out the solution to the problem it was related to a conflict with multithreading in the CE environment.

The solution we found was to do the following

#undef _MT
#include <map>
#define _MT

this can be done within the stdafx.h at the bottom or in the header file in which the parts of the code are being used.

Thanks for all the help that people have offered.
0
 
LVL 9

Expert Comment

by:tinchos
ID: 10286250
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

PAQ with points refunded

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Tinchos
EE Cleanup Volunteer
0
 

Accepted Solution

by:
SpazMODic earned 0 total points
ID: 10347372
PAQed, with points refunded (125)

SpazMODic
EE Moderator
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org (http://seleniumhq.org) Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now