#144 GCC: error: 'round' is not a member of 'std'


Recent qucs snapshots introduced use of C++11 features, like in:

nr_double_t round (const nr_double_t arg) {
// std::round was introduced in C++11
#ifndef HAVE_ROUND
  return (arg > 0) ? floor (arg + 0.5) : ceil (arg - 0.5);
  return std::round (arg);
#endif /* HAVE_ROUND */

However, the autoconf code does not probe for the C++11 feature but for a
generic (old-style <math.h>) round() without the std:: prefix. Consequently,
HAVE_ROUND is defined (since it was probed successfully), but then fails to
compile with at least older GCC versions (4.7 here).

IMHO, the autoconf probing code should be changed to really test for the C++11
features that are going to be used. Even better, the implementation might
be turned into a three-way decision: 1) C++11 features present; 2) C++11
features not present but standard <math.h> functions usable; 3) own
workaround implementation needed.


  • Dmitry Marakasov

    Please ignore this - it is caused by interoperability of gcc and FreeBSD math library and is not qucs problem.

  • Guilherme

    Guilherme - 2014-05-14
    • status: open --> closed-fixed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks