delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/03/11/18:55:36

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:date:message-id:subject:from:to
:content-type:content-transfer-encoding; q=dns; s=default; b=wUA
BqZHkrUknRvkjco+he4YNkrLAp+9X1OrKJDZ1MhzQTNTrqFpC+OJ4gmS0NlpgFXe
sG1tWi4/NwgHqyTxP7k+7nCwuujVMRGGezrcM7sL5ZB2+feas2FQtcIdrPLrr8E5
FKUC1GIKoVyYEjsvRKre2+8lXbIIfCfrrapEXBjI=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:date:message-id:subject:from:to
:content-type:content-transfer-encoding; s=default; bh=R/5k2+hGu
MCKadgITWu0MwTAo0s=; b=xZOrMGVtn9Ua0E1pgE4ZZ8qsE3vObHJdPL2iKyZh1
tJxYxRZaCJciZtdm2W1xB3im/kiVvwQhH3TvNGyBtrHDAMgcV5ed37RjsFpqiF3D
tFEGtpGP75Q4dVibTNP+h4UYC9k5mp3XU/fjp/cblhbR+nThJGlnH9PLl1jwM3y5
kA=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=3.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_FROM_URIBL_PCCC,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2
X-HELO: mail-qc0-f171.google.com
MIME-Version: 1.0
X-Received: by 10.140.234.136 with SMTP id f130mr52720275qhc.49.1426114516745; Wed, 11 Mar 2015 15:55:16 -0700 (PDT)
Date: Wed, 11 Mar 2015 18:55:16 -0400
Message-ID: <CAJ+GnyeViXtbQ6S=tC6z8XVZgOcoHv6Gi0ww8W1HEG_XKJrhUw@mail.gmail.com>
Subject: g++4.9.2 fails to compile standard C++11 code
From: Vlad Gheorghiu <vgheorgh AT gmail DOT com>
To: cygwin AT cygwin DOT com
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id t2BMtWxu026746

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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019