\xtr1common(252) : error C2766: 显式专用化;

时间:2022-08-25 19:11:44
照着一个代码复制粘贴,弄了一个MFC,可是在编译的时候出现了这个错误,上网各种搜索,未果,只能来板上求助各位大神了,还望不吝赐教啊。具体错误如下:
1>G:\Program Files\Microsoft Visual Studio 9.0\VC\include\xtr1common(252) : error C2766: 显式专用化;已定义“std::tr1::_Is_integral<BOOL>”
1>        G:\Program Files\Microsoft Visual Studio 9.0\VC\include\xtr1common(200) : 参见“_Is_integral<int>”的前一个定义

8 个解决方案

#1


贴上xtr1common 200行-252行的代码?貌似,stl库有问题

#2


BOOL 在MFC的某头文件中已被定义了(typedef BOOL int)。

参考下。

#3



引用 1 楼  的回复:
贴上xtr1common 200行-252行的代码?貌似,stl库有问题

template<>
struct _Is_integral<bool>
: true_type
{ // determine whether _Ty is integral
};

template<>
struct _Is_integral<char>
: true_type
{ // determine whether _Ty is integral
};

template<>
struct _Is_integral<unsigned char>
: true_type
{ // determine whether _Ty is integral
};

template<>
struct _Is_integral<signed char>
: true_type
{ // determine whether _Ty is integral
};

 #ifdef _NATIVE_WCHAR_T_DEFINED
template<>
struct _Is_integral<wchar_t>
: true_type
{ // determine whether _Ty is integral
};
 #endif /* _NATIVE_WCHAR_T_DEFINED */

template<>
struct _Is_integral<unsigned short>
: true_type
{ // determine whether _Ty is integral
};

template<>
struct _Is_integral<signed short>
: true_type
{ // determine whether _Ty is integral
};

template<>
struct _Is_integral<unsigned int>
: true_type
{ // determine whether _Ty is integral
};

template<>
struct _Is_integral<signed int>
: true_type
{ // determine whether _Ty is integral
};

#4



引用 2 楼  的回复:
BOOL 在MFC的某头文件中已被定义了(typedef BOOL int)。

参考下。

我查找了整个解决方法,没查找到这句话啊

#5


把你错误的代码贴出来看看~

#6


我的是一个大的程序,这个是在编译的时候就出错了,不知道错在哪啊
引用 5 楼  的回复:
把你错误的代码贴出来看看~

#7


有没有人遇到过这个问题啊,急求啊!!!

#8


问题已解决,换了VS2012没有错误

#1


贴上xtr1common 200行-252行的代码?貌似,stl库有问题

#2


BOOL 在MFC的某头文件中已被定义了(typedef BOOL int)。

参考下。

#3



引用 1 楼  的回复:
贴上xtr1common 200行-252行的代码?貌似,stl库有问题

template<>
struct _Is_integral<bool>
: true_type
{ // determine whether _Ty is integral
};

template<>
struct _Is_integral<char>
: true_type
{ // determine whether _Ty is integral
};

template<>
struct _Is_integral<unsigned char>
: true_type
{ // determine whether _Ty is integral
};

template<>
struct _Is_integral<signed char>
: true_type
{ // determine whether _Ty is integral
};

 #ifdef _NATIVE_WCHAR_T_DEFINED
template<>
struct _Is_integral<wchar_t>
: true_type
{ // determine whether _Ty is integral
};
 #endif /* _NATIVE_WCHAR_T_DEFINED */

template<>
struct _Is_integral<unsigned short>
: true_type
{ // determine whether _Ty is integral
};

template<>
struct _Is_integral<signed short>
: true_type
{ // determine whether _Ty is integral
};

template<>
struct _Is_integral<unsigned int>
: true_type
{ // determine whether _Ty is integral
};

template<>
struct _Is_integral<signed int>
: true_type
{ // determine whether _Ty is integral
};

#4



引用 2 楼  的回复:
BOOL 在MFC的某头文件中已被定义了(typedef BOOL int)。

参考下。

我查找了整个解决方法,没查找到这句话啊

#5


把你错误的代码贴出来看看~

#6


我的是一个大的程序,这个是在编译的时候就出错了,不知道错在哪啊
引用 5 楼  的回复:
把你错误的代码贴出来看看~

#7


有没有人遇到过这个问题啊,急求啊!!!

#8


问题已解决,换了VS2012没有错误