'Treat wchar_t as Built-In type' set to 'No' (/Zc:wchar_t-) causes a build
failure because of the duplicate template specialization caused by wchar_t
being typedef-ed as a unsigned short.
The full error is:
tclap-1.2.0\include\tclap\StandardTraits.h(175) : error C2766: explicit
specialization; 'TCLAP::ArgTraits<unsigned short>' has already been
defined
tclap-1.2.0\include\tclap\StandardTraits.h(106) : see previous
definition of 'ArgTraits<unsigned short>'
The solution I came up with is to not declare the specialization if the
compiler is MSVC and if wchar_t is not defined as a native type, something
like this:
#ifdef _MSC_VER
#ifndef _NATIVE_WCHAR_T_DEFINED
#define TCLAP_DONT_DECLARE_WCHAR_T_ARGTRAITS
#endif
#endif
Then do something like this in StandardTraits.h:
#ifndef TCLAP_DONT_DECLARE_WCHAR_T_ARGTRAITS
template<>
struct ArgTraits<wchar_t> {
typedef ValueLike ValueCategory;
};
#endif
Mike Smoot
None
None
Public
|
Date: 2009-10-23 21:43 Thanks for the patch, I just committed the change to CVS. This will make |
| Field | Old Value | Date | By |
|---|---|---|---|
| status_id | Open | 2009-10-23 21:43 | mes5k |
| resolution_id | None | 2009-10-23 21:43 | mes5k |
| assigned_to | nobody | 2009-10-23 21:43 | mes5k |
| close_date | - | 2009-10-23 21:43 | mes5k |
Copyright © 2009 Geeknet, Inc. All rights reserved. Terms of Use