pablete
asked on
Embedded Visual C++ and namespaces
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
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
ASKER
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
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
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.
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.
Oh didn't notice that you had VC++ 3.0. Sorry. I have no clue how namespace works with that dinosaur.
ASKER
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
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
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?
ASKER
That is wierd, if it is supported, how come I can't compile the code I post before?
Pablo
Pablo
can't you post the complete code? even stdafx.h
wait a moment, I'll try myself
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Make sure you have the directory pointed out in the tools->options where you have installed it in eVC
Make sure you have the directory pointed out in the tools->options where you have installed it in eVC
You must include at least one headerfile that defines (declares) namespace std. Write #include <list> for example before 'using namespace std'