ブースト 1.52.1 と gcc-4.7.1 を使用してコードをコンパイルすると、次のエラーが表示されます。これは、boost と c++ ライブラリ間の競合のようです。この問題を解決する方法を知っている人はいますか?
お返事ありがとうございます。
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
エラーはコード boost\math\policy\error_handling.hpp に表示されます。しかし、プログラムがこれらの関数をいつ引用するかはわかりません。このエラーはどのように発生しますか?
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;
}