delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/01/15/04:08:58

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=Wh9
fkXkdRYCFQlZiLLOhTRFX2cTdMFzG7APtU8xNS6rYd2ws+SnuGhJBNXp6SHc4MrR
MMooIO8sTvhg2QEk10yTGbj9kiQy4o8zN+roJ2wbJt8EY74VIo6GjBe2LRb+PZKN
TFbObWeYFdH7zja8CdEICiethFL0rAZFdlz6Pkak=
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=h6ZkpY3gX
bmvCArkVhul93UiDi8=; b=Zw67Su1nomY7J091Y5mGGaGorpvlMp0qoaL3J0RSB
MjNgJp7DwVNNC1J6wneeKDUvlz8xBd1idf/k8GyYo18qnXvPb2emBRb47e/+ocjy
2gPUFm0CTdGceogtBplsuV5KFwoyjthi3l1FXPHeqAv/qyAh2lZ6en+B7FF0SdEG
M4=
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=1.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2
X-HELO: mail-la0-f54.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=jHW4ktDG4luBxRAa88tyqWe5ksSMLDrY+DlaZeYZzVw=; b=N2rkC7VXsbrI738U4s+MLCL49J2dsWEeS3yi/zvQ1luRLZvXB2xqsoIxDiHNNEGCAH FoAhVq6uVbXXE503Zl+EWCgqodjhwUgTignPicLfV7FqIsL97sc//sCPpTKxrmFjyr81 vPF/ag/lY/KeB9jiGwFKRifOWOSk/8ja7F7kl0uDnibl5xN7YSfu8PQfspThuZ4Fp1fN Q9eUOg2lSsAkXMDSz+iKJ5AJQSXRY4D/ORGbrDPMK6Jt6k1FyO7s516yIdmuTrvsB1fL q5lVNvUMZKIZrD1sr8Lf4wKlhJa116nIHVM07uwI0rQjU9xpn587YdPow7Uh1R0NhLQd v/yQ==
X-Gm-Message-State: ALoCoQl/k7h7pcd4OfdEoHBk69Dt8h9b0sL5PiSL/JgchMi5LP7OhCKyNKH26nbbgOewKbHXeNDX
MIME-Version: 1.0
X-Received: by 10.152.28.230 with SMTP id e6mr762017lah.3.1389776915233; Wed, 15 Jan 2014 01:08:35 -0800 (PST)
Date: Wed, 15 Jan 2014 10:08:35 +0100
Message-ID: <CAGAuH46E+FWFt_vMDOyQiEKLANRmJ8KydX-YcKfrFm=UeHy3uw@mail.gmail.com>
Subject: g++: <cmath> is missing C++11 functions
From: Achille Fouilleul <achille DOT fouilleul AT gadz DOT org>
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id s0F98qMP020548

Hi,

On cygwin64, g++ -std=c++11 fails to compile simple programs like this one:

#include <cstdio>
#include <cmath>

int main()
{
  std::printf("%d\n", (int)std::lround(1.23));
  return 0;
}

rr.cpp: In function ‘int main()’:
rr.cpp:6:28: error: ‘lround’ is not a member of ‘std’
   std::printf("%d\n", (int)std::lround(1.23));
                            ^
rr.cpp:6:28: note: suggested alternative:
In file included from
/usr/lib/gcc/x86_64-pc-cygwin/4.8.2/include/c++/cmath:44:0,
                 from rr.cpp:2:
/usr/include/math.h:278:17: note:   ‘lround’
 extern long int lround _PARAMS((double));

I have noticed that C++11 cmath functions are declared in the std
namespace only if _GLIBCXX_USE_C99_MATH_TR1 is defined.
It's not:
/usr/lib/gcc/x86_64-pc-cygwin/4.8.2/include/c++/x86_64-pc-cygwin/bits/c++config.h:1272:/*
#undef _GLIBCXX_USE_C99_MATH_TR1 */

Regards,
Achille

--
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