c++ - VC++ 6.0 中的 Cfitsio 错误

标签 c++ class templates visual-c++

我正在连接两个软件,其中一个使用 sfits 库来处理适合的图像,当编译程序时它在 XLOCALE 文件中显示错误,该文件位于 vc98/include 文件夹中,我使用的是 vc 6.0 和 XP,

error : error C2955: 'ctype' : use of class template requires template argument list C:\Program Files\Microsoft Visual Studio6\VC98\INCLUDE\xlocale(513) : see declaration of 'ctype'

error is pointing to 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;

提前致谢...

最佳答案

ctype 是类型的模板,而不是类型本身。您的参数必须是 ctype<char>ctype<wchar_t>取决于您使用的字符类型。

关于c++ - VC++ 6.0 中的 Cfitsio 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5448993/

相关文章:

C++ : declaring in if/else : var not declared in this scope

将在该 block 之后执行一段代码和特定命令的 C++ MACRO

c++ - 如何在两个 boost::intrusive::slist 对象之间传输节点

javascript - 确认使用工厂是创建通用多用途点击计数监听器的最佳(唯一?)方法

python - self.__class__.__bases__ 不会追溯到类对象

c++ - 模板构造函数出现预期的不合格 ID 错误

django - 检查 django.test.TestCase 中的模板名称

c++ - Qt QHBoxLayout 百分比大小

CSS类不工作

c++ - 尝试创建链接列表堆栈时出现链接器错误