相关的编译错误提振 [英] compiling errors related boost
问题描述
当我使用升压1.52.1和gcc-4.7.1编译我的code,出现以下错误。看来这是升压和C ++库之间的冲突。
可能有些人知道如何解决这个问题呢?
您的回复非常感谢。
C:\\ Program Files文件\\ mingw64 \\ BIN \\ LIB ../ / GCC / x86_64的,w64-
mingw32的/ 4.7.1 /../../../../包括/升压/数学/政策
/error_handling.hpp:在函数'布尔提振::数学::政策::
细节:: check_overflow(的std ::复杂< T&GT ;,
R *,为const char *,const的政策及放大器;):C:\\程序
文件\\ mingw64 \\ BIN \\ LIB ../ / GCC / x86_64的-W64的mingw32 / 4.7.1
/../../../../include/boost/math/policies/error_handling.hpp:583:11:
错误:数字常量之前的预期不合格-ID
C:\\ Program Files文件\\ mingw64 \\ BIN \\ LIB ../ / GCC / x86_64的-W64-的mingw32
/4.7.1/../../../../include/boost/math/policies/error_handling.hpp:
584:49:错误:左值要求作为一元'和;'操作
C:\\ Program Files文件\\ mingw64 \\ BIN \\ LIB ../ / GCC / x86_64的-W64-的mingw32 / 4.7.1 /
../../../../include/boost/math/policies/
error_handling.hpp:584:107:错误:'聊天室'在这个未声明
范围C:\\ Program Files文件\\ mingw64 \\ BIN \\ LIB ../ / GCC / x86_64的-W64-的mingw32
/4.7.1/../../../../include/boost/math/policies/error_handling。
HPP:在函数'布尔提振::数学::政策::详细::
check_underflow(的std ::复杂<吨>中R *,为const char *,const的政策及放大器;):
C:\\ Program Files文件\\ mingw64 \\ BIN \\ LIB ../ / GCC / x86_64的,w64-的mingw32
/4.7.1/../../../../include/boost/math/policies
/error_handling.hpp:602:11:错误:预期不合格-ID之前
数字常量C:\\ Program Files文件\\ mingw64 \\ BIN \\ LIB ../ / GCC /
x86_64的-W64的mingw32 / 4.7.1 /../../../../包括/升压/数学/政策
/error_handling.hpp:603:50:错误:左值要求作为
一元'和;'操作数C:\\ Program Files文件\\ mingw64 \\ BIN \\ LIB ../ / GCC /
x86_64的-W64的mingw32 / 4.7.1 /../../../../包括/升压/数学/政策
/ error_handling .HPP:603:109:错误:'聊天室'中未声明
此范围内C:\\ Program Files文件\\ mingw64 \\ BIN \\ LIB ../ / GCC
/x86_64-w64-mingw32/4.7.1/../../../../include/boost/math/policies/
error_handling.hpp:在函数'布尔提振::数学::政策::
细节:: check_denorm(的std ::复杂<吨>中R *,为const char *,
const的政策和放大器;):C:\\ Program Files文件\\ mingw64 \\ BIN \\ LIB ../ / GCC
/x86_64-w64-mingw32/4.7.1/../../../../include/boost/
数学/政策/ error_handling.hpp:622:11:错误:预期
数字常量前不合格-ID
C:\\ Program Files文件\\ mingw64 \\ BIN \\ LIB ../ / GCC / x86_64的,w64-
mingw32的/ 4.7.1 /../../../../包括/升压/数学/政策/
error_handling.hpp:623:47:错误:左值要求作为
一元'和;'操作
C:\\ Program Files文件\\ mingw64 \\ BIN \\ LIB ../ / GCC / x86_64的,w64-
mingw32的/ 4.7.1 /../../../../包括/升压/数学/政策/
error_handling.hpp:623:103:错误:'聊天室'未声明
在此范围内
出现在code提振\\数学\\政策\\ error_handling.hpp错误。但我不知道当程序引用这些功能。这是如何发生的错误?
模板<类R,T类,类政策>
内联BOOL check_overflow(的std ::复杂< T> VAL,R *结果,常量
字符*函数,常量政策及放大器; POL)
{
的typedef typename的ř:: value_type的R_TYPE;
R_TYPE重,即时通讯;
BOOL R = check_overflow<&R_TYPE GT;(val.real(),放大器;再次,功能,POL)|| check_overflow<&R_TYPE GT;(val.imag(),放大器; IM,功能,POL);
*结果= R(重,即时通讯);
返回ř;
} 模板<类R,T类,类政策>
内联BOOL check_underflow(的std ::复杂< T> VAL,R *结果,为const char *函数,常量政策及放大器; POL)
{
的typedef typename的ř:: value_type的R_TYPE;
R_TYPE重,即时通讯;
BOOL R = check_underflow<&R_TYPE GT;(val.real(),放大器;再次,功能,POL)|| check_underflow<&R_TYPE GT;(val.imag(),放大器; IM,功能,POL);
*结果= R(重,即时通讯);
返回ř;
}
鉴于这种两个功能,这嘈杂的错误消息,我可以说,类型作为参数R不定义 VALUE_TYPE
。正因为如此,键入 R_TYPE
和变量即时消息
和重新
没有定义。作为结果,你得到错误:'聊天室'在此范围未声明
错误
使用仅供code,我可以看到,R型有这样的要求:
- 它必须定义类型
VALUE_TYPE
- 它必须具有构造
R(VALUE_TYPE真实的,VALUE_TYPE想象)
这一切都意味着您使用不正确地使用internaly check_underflow / check_overflow功能,不兼容的模板参数一些boost库,我猜。
When I use boost 1.52.1 and gcc-4.7.1 to compile my code, the following errors appear. It seems this is conflict between boost and c++ library. Could some know how to resolve this problem?
Many thanks for your reply.
c:\program files\mingw64\bin\../lib/gcc/x86_64-w64-
mingw32/4.7.1/../../../../include/boost/math/policies
/error_handling.hpp: In function 'bool boost::math::policies::
detail::check_overflow(std::complex<T>,
R*, const char*, const Policy&)':c:\program
files\mingw64\bin\../lib/gcc/x86_64-w64 mingw32/4.7.1
/../../../../include/boost/math/policies/error_handling.hpp:583:11:
error: expected unqualified-id before numeric constant
c:\program files\mingw64\bin\../lib/gcc/x86_64-w64-mingw32
/4.7.1/../../../../include/boost/math/policies/error_handling.hpp:
584:49: error: lvalue required as unary '&' operand
c:\program files\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.1/
../../../../include/boost/math/policies/
error_handling.hpp:584:107: error: 'im' was not declared in this
scope c:\program files\mingw64\bin\../lib/gcc/x86_64-w64-mingw32
/4.7.1/../../../../include/boost/math/policies/error_handling.
hpp: In function 'bool boost::math::policies::detail::
check_underflow(std::complex<T>, R*, const char*, const Policy&)':
c:\program files\mingw64\bin\../lib/gcc/x86_64-w64- mingw32
/4.7.1/../../../../include/boost/math/policies
/error_handling.hpp:602:11: error: expected unqualified-id before
numeric constant c:\program files\mingw64\bin\../lib/gcc/
x86_64-w64 mingw32/4.7.1/../../../../include/boost/math/policies
/error_handling.hpp:603:50: error: lvalue required as
unary '&' operand c:\program files\mingw64\bin\../lib/gcc/
x86_64-w64 mingw32/4.7.1/../../../../include/boost/math/policies
/error_handling .hpp:603:109: error: 'im' was not declared in
this scope c:\program files\mingw64\bin\../lib/gcc
/x86_64-w64-mingw32/4.7.1/../../../../include/boost/math/policies/
error_handling.hpp: In function 'bool boost::math::policies::
detail::check_denorm(std::complex<T>, R*, const char*,
const Policy&)':c:\program files\mingw64\bin\../lib/gcc
/x86_64-w64-mingw32/4.7.1/../../../../include/boost/
math/policies/error_handling.hpp:622:11: error: expected
unqualified-id before numeric constant
c:\program files\mingw64\bin\../lib/gcc/x86_64-w64-
mingw32/4.7.1/../../../../include/boost/math/policies/
error_handling.hpp:623:47: error: lvalue required as
unary '&' operand
c:\program files\mingw64\bin\../lib/gcc/x86_64-w64-
mingw32/4.7.1/../../../../include/boost/math/policies/
error_handling.hpp:623:103: error: 'im' was not declared
in this scope
The error appears in the code boost\math\policy\error_handling.hpp. But I am not sure when the program cite these functions. How does this error happen?
template <class R, class T, class Policy>
inline bool check_overflow(std::complex<T> val, R* result, const
char* function, const Policy& pol)
{
typedef typename R::value_type r_type;
r_type re, im;
bool r = check_overflow<r_type>(val.real(), &re, function, pol) || check_overflow<r_type>(val.imag(), &im, function, pol);
*result = R(re, im);
return r;
}
template <class R, class T, class Policy>
inline bool check_underflow(std::complex<T> val, R* result, const char* function, const Policy& pol)
{
typedef typename R::value_type r_type;
r_type re, im;
bool r = check_underflow<r_type>(val.real(), &re, function, pol) || check_underflow<r_type>(val.imag(), &im, function, pol);
*result = R(re, im);
return r;
}
Given this two functions and this noisy error message I can say that type that was used as parameter R doesn't defines value_type
. Because of that, type r_type
and variables im
and re
is not defined. As result you get error: 'im' was not declared in this scope
error.
Using only provided code I can saw that type R has this requirements:
- It must define type
value_type
- It must have constructor
R(value_type real, value_type imagine)
All this means that you use some boost library that uses internaly check_underflow/check_overflow functions incorrectly, with incompatible template argument, I guess.
这篇关于相关的编译错误提振的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!