我正在连接两个软件,其中一个是使用sfits库来处理适合图像,当编译程序时它在XLOCALE文件中显示错误,该文件记录在vc98 / include文件夹中,即时使用vc 6.0与XP,
错误:错误C2955:'ctype':使用 类模板需要模板 参数列表C:\ Program Files \ Microsoft Visual Studio6 \ VC98 \ INCLUDE \ xlocale(513): 见'ctype'的声明
错误指向line:int fits_get_compression_type(fitsfile * fptr,int * ctype,int * status);
并在XLOCALE文件中指向:
template<class _E>
class ctype : public ctype_base {
public:
typedef _E char_type;
ctype(const _Locinfo& _Lobj, size_t _R = 0)
: ctype_base(_R) {_Init(_Lobj); }
static size_t __cdecl _Getcat()
{return (_LC_CTYPE); }
_PROTECTED:
virtual ~ctype()
{if (_Ctype._Delfl)
free((void *)_Ctype._Table); }
protected:
virtual const _E *do_narrow(const _E *_F, const _E *_L,
char, char *_V) const
{for (; _F != _L; ++_F, ++_V)
*_V = (char)_NARROW(_E, *_F);
return (_F); }
private:
_Locinfo::_Ctypevec _Ctype;
};
template<class _E>
locale::id ctype<_E>::id;
提前致谢...
答案 0 :(得分:1)
ctype是类型的模板,而不是类型本身。您的参数必须为ctype<char>
或ctype<wchar_t>
,具体取决于您使用的字符类型。