This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

g++4.9.2 fails to compile standard C++11 code


The following code fails to compile under latest cygwin, Windows 7,
g++4.9.2. Compiled with g++ -std=c++11 test.cpp. The compiler
complains that std::log2 is not a member of std.

    #include <cmath>
    #include <iostream>

    int main()
    {
            auto x = std::log2(10);
            std::cout << x << std::endl;
    }


Verbatim error:

    g++ -std=c++11 test.cpp
    test.cpp: In function âint main()â:
    test.cpp:5:11: error: âlog2â is not a member of âstdâ
      auto x = std::log2(10);
               ^
    test.cpp:5:11: note: suggested alternative:
    In file included from
/usr/lib/gcc/i686-pc-cygwin/4.9.2/include/c++/cmath:44:0,
                     from test.cpp:1:
    /usr/include/math.h:305:15: note:   âlog2â
     extern double log2 _PARAMS((double));

-- 
Dr. Vlad Gheorghiu
Institute for Quantum Computing
Waterloo, Ontario
Canada
http://community.iqc.uwaterloo.ca/vgheorgh/

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]