TCLAP std::wstring
issue.
Hello All,
I am using TCLAP(command line parsing utility). It has worked well so far until I ran into issues with wstring processing capability.
I have the below line to parse code for an UnlabeledValueArg
std::wstring defaultValue;
UnlabeledValueArg<std::wstring>
serverName("COMPUTERNAME", "List all scheduled tasks of computer", false,
defaultValue, "string" );
I run into compile time issues ( Visual Studio spits out incredulous amounts of issues.). My question is have anyone tried using std::wstring with TCLAP. If yes can you post the solution or the approach to it. Thanks.
Edit - The compiler warnings I get is -
C:\DevProjects\MyProjects\nttoolkit\trunk\external\tclap/StandardTraits.h(187) : error C2679: binary '=' : no operator found which takes a right-hand operand of type 'const std::string' (or there is no acceptable conversion)
c:\Program Files (x86)\Microsoft Visual Studio
9.0\VC\include\xstring(914): could be 'std::basic_string<_Elem,_Traits,_Ax>
&std::basic_string<_Elem,_Traits,_Ax>::operator
=(const std::basic_string<_Elem,_Traits,_Ax> &)' with [ _Elem=wchar_t, _Traits=std::char_traits, _Ax=std::allocator ]
c:\Program Files (x86)\Microsoft Visual Studio
9.0\VC\include\xstring(919): or 'std::basic_string<_Elem,_Traits,_Ax> &std::basic_string<_Elem,_Traits,_Ax>::operator =(const _Elem *)' with [ _Elem=wchar_t, _Traits=std::char_traits, _Ax=std::allocator ]
c:\Program Files (x86)\Microsoft Visual Studio
9.0\VC\include\xstring(924): or 'std::basic_string<_Elem,_Traits,_Ax> &std::basic_string<_Elem,_Traits,_Ax>::operator =(_Elem)' with [ _Elem=wchar_t, _Traits=std::char_traits, _Ax=std::allocator ] while trying to match the argument list '(std::wstring, const std::string)'
C:\DevProjects\MyProjects\nttoolkit\trunk\external\tclap/Arg.h(446)
: see reference to function template instantiation 'void TCLAP::SetString(T &,const std::string &)' being compiled with [ T=std::wstring ]
C:\DevProjects\MyProjects\nttoolkit\trunk\external\tclap/ValueArg.h(391)
: see reference to function template instantiation 'void TCLAP::ExtractValue(T &,const std::string &,TCLAP::StringLike)' being compiled with [ T=std::wstring ]
C:\DevProjects\MyProjects\nttoolkit\trunk\external\tclap/ValueArg.h(389)
: while compiling class template member function 'void TCLAP::ValueArg::_extractValue(const std::string &)' with [ T=std::wstring ]
C:\DevProjects\MyProjects\nttoolkit\trunk\external\tclap/ValueArg.h(325)
: while compiling class template member function 'bool TCLAP::ValueArg::processArg(int *,std::vector<_Ty> &)' with [ T=std::wstring, _Ty=std::string ]
C:\DevProjects\MyProjects\nttoolkit\trunk\external\tclap/UnlabeledValueArg.h(44)
: see reference to class template
instantiation 'TCLAP::ValueArg' being compiled with [ T=std::wstring ]
C:\DevProjects\MyProjects\nttoolkit\trunk\tasksecure\src\main.cpp(26)
: see reference to class template instantiation 'TCLAP::UnlabeledValueArg' being compiled with [ T=std::wstring ]
TaskSecure - 1 error(s), 6 warning(s)