Embedded Visual C++ and namespaces

pablete
pablete used Ask the Experts™
on
Hi,

I am trying to write some code with Embedded Visual C++ 3.0 using namespaces.

Although in the compiler help namespaces are explained, it seems the compiler does not support them.

If I try to compile this code:

// testemb.cpp : Defines the entry point for the application.
//

#include "stdafx.h"

using namespace std;

int WINAPI WinMain(     HINSTANCE hInstance,
                         HINSTANCE hPrevInstance,
                         LPTSTR    lpCmdLine,
                         int       nCmdShow)
{
     return 0;
}



I get the following error:

error C2871: 'std' : does not exist or is not a namespace

Have any of you guys has faced the same problem?

Thanx,

Pablo
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
namespace works perfectly well with eVC++

You must include at least one headerfile that defines (declares) namespace std. Write #include <list> for example before 'using namespace std'

 

Author

Commented:
I've tried that and it does not work either.

The new code is:

// testemb.cpp : Defines the entry point for the application.
//

#include "stdafx.h"

#include <list>
using namespace std;

int WINAPI WinMain(     HINSTANCE hInstance,
                         HINSTANCE hPrevInstance,
                         LPTSTR    lpCmdLine,
                         int       nCmdShow)
{
      // TODO: Place code here.

     return 0;
}

and the error is

fatal error C1083: Cannot open include file: 'list': No such file or directory

thanx again for ur help,

Pablo
EOL

Commented:
Maybe because at version 3 of VC templates where not much of a topic, so lists wheren't too. I don't even know if the std namespace existed at VC 3.

Just out of curiosity, what evil forces you to use VC 3?

And I have to object, namespaces work not so well in any VC release. For example was VC6 sometimes not able to resolve the namespaces with very simple setups, problems I haven't VC7 so far.
Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

Commented:
Oh didn't notice that you had VC++ 3.0. Sorry. I have no clue how namespace works with that dinosaur.

Author

Commented:
Hey guys,

it is EMBEDDED visual C++ 3, the Microsoft compiler for developing Windows CE applications. I know there is already the release 4.0, but it doesn't come with the Pocket PC SDK (and that is what I am trying to write, a Pocket PC app).

More suggestions?

Pablo

Commented:
oh, now I understand. Yes I have worked with eVC++ 3.0 with PocketPC SDK. namespaces works just fine with it. I have used STL in my projects. So I guess you need Pocket PC SDK 2002?

Author

Commented:
That is wierd, if it is supported, how come I can't compile the code I post before?

Pablo

Commented:
can't you post the complete code? even stdafx.h

Commented:
wait a moment, I'll try myself
Commented:
STL is not included in eVC++ 3.0 or PocketPC SDK

You have to download it by yourself. SGI has one that I am using and it work rather well. SGI is one of the most used STL provider with STLPORT and BOOST (I think)

Here is a link.

http://www.syncdata.it/stlce/stldownload.html

Commented:
Make sure you have the directory pointed out in the tools->options where you have installed it in eVC

Commented:
Make sure you have the directory pointed out in the tools->options where you have installed it in eVC

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial