I had a problem trying typedef to create a nice handy tstring (see below)
#ifndef _NISAMPLECLIENT_H_
#define _NISAMPLECLIENT_H_
#include <windows.h>
#include <stdlib.h>
using namespace std;
#ifdef _UNICODE
#define CommandLineToArgv CommandLineToArgvW
#else
#define CommandLineToArgv CommandLineToArgvA
#endif
typedef basic_string<TCHAR> tstring;
I get a compiler error when trying to compile this. Error in "ERROR here (1)":
Error 3 of error C2871: 'std': a namespace with this name does not exist \ nisampleclient \ nisampleclientdefs.h 16
If I delete the ad using namespace std;and change the ERROR HERE (2) to say typedef std::basic_string<TCHAR> tstring;, then I get the error message:
Error 3 of error C2653: 'std': is not the name of a class or namespace \ nisampleclient \ nisampleclientdefs.h 23
instead of this.
Thanks in advance.:)
source
share