Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8986359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:31:51+00:00 2026-06-15T21:31:51+00:00

When I use boost 1.52.1 and gcc-4.7.1 to compile my code, the following errors

  • 0

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;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T21:31:53+00:00Added an answer on June 15, 2026 at 9:31 pm

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use the boost library in my code but get the following
I'm trying to use Boost::Interprocess but I have some compiler errors when trying to
I'm trying to use the C++ Boost library to write some depth data I
I'm having some troubles understanding MPL placeholders. Could someone please explain me why this
The following compiles under VS2010 (Express) but not gcc (4.6.2 here). Lockable.h: #include <boost/thread/mutex.hpp>
I use boost a lot in my code but have so far refrained from
I have the following code: typedef boost::variant<LandSearchParameter, WaterSearchParameter> SearchParameter; enum Visibility{ CLEAR, CLOUDY, FOG,
I wrote a c++ program using boost library in Xcode. Here is my code.
In my project, I recently decided to use boost::thread. My code compiles fine under
I use boost trim function and find it perform very well in single-thread environment.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.