[MacPorts] #53226: PowerMac, GCC 5.4 and "error: 'std::log2' has not been declared"

MacPorts noreply at macports.org
Fri Jan 6 02:07:59 UTC 2017


#53226: PowerMac, GCC 5.4 and "error: 'std::log2' has not been declared"
------------------------------+----------------------
 Reporter:  noloader          |      Owner:
     Type:  defect            |     Status:  new
 Priority:  Normal            |  Milestone:
Component:  ports             |    Version:  2.3.5
 Keywords:  c++11 cmath log2  |       Port:  g++-mp-5
------------------------------+----------------------
 I'm working on a PowerMac G5. It runs OS X 10.5.8. It has MacPorts
 installed for updated gear. The machine survives specifically for big-
 endian PowerPC testing.

 {{{
 $ cat test.cxx
 #include <cmath>
 int main(int argc, char* argv[])
 {
     double d = std::log2(2.3456789f);
     return 0;
 }
 }}}

 Compiling a program which uses {{{log2}}} under C++11 results in a compile
 error {{{'std::log2' has not been declared}}}:

 {{{
 $ /opt/local/bin/g++-mp-5 -std=c++11 test.cxx -o test.exe
 test.cxx: In function 'int main(int, char**)':
 test.cxx:4:16: error: 'log2' is not a member of 'std'
      double d = std::log2(2.3456789f);
                 ^
 test.cxx:4:16: note: suggested alternative:
 In file included from /usr/include/math.h:26:0,
                  from /opt/local/include/gcc5/c++/cmath:44,
                  from test.cxx:1:
 /usr/include/architecture/ppc/math.h:431:15: note:   'log2'
  extern double log2( double );
                ^
 }}}

 MacPorts is version 2.3.5 and fully patched. GCC version string is:

 {{{
 $ /opt/local/bin/g++-mp-5 --version
 g++-mp-5 (MacPorts gcc5 5.4.0_0) 5.4.0
 Copyright (C) 2015 Free Software Foundation, Inc.
 ...
 }}}

--
Ticket URL: <https://trac.macports.org/ticket/53226>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list