I’ve the following
namespace settings{
#if defined(WIN32) && !defined(UNIX)
typedef wchar_t char_t;
#elif defined(UNIX) && !defined(WIN32)
typedef char char_t;
#else
typedef char char_t;
#endif
typedef std::basic_string<char_t> string_t;
typedef std::basic_ostream<char_t> stream_t;
}
I kept it such that I can change the whole application taking chat to wchar. It works in Linux but when I tried to compile the same in VS 2010 It is giving me
error C2371: ‘settings::char_t’ : redefinition; different basic types
see declaration of ‘settings::char_t’
all my code uses settings::char_t and settings::string_t etc .. Now Do I need to change all my code ? or there is some easier way out ?
Even if it were a global, your typedef is enclosed in
namespace settingand you would get more information about this. Are you sure the file isn’t being targetted twice in the project?