delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/11/29/05:05:01

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-0.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Subject: How to get std::strtoull (unsigned long long)?
X-KeepSent: AEC4844B:D2808564-C1257957:0035691D; type=4; name=$KeepSent
To: cygwin AT cygwin DOT com
Message-ID: <OFAEC4844B.D2808564-ONC1257957.0035691D-C1257957.00374E79@de.ibm.com>
From: Markus Selve <MSELVE AT de DOT ibm DOT com>
Date: Tue, 29 Nov 2011 11:04:07 +0100
MIME-Version: 1.0
x-cbid: 11112910-8372-0000-0000-000000F1D7AA
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
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id pATA4wXB003842

Hello,

I'm trying to use std::strtoull in a C++ program, but compiling it I get:

 error: 'strtoull' is not a member of 'std'

It works, if I use strtoul ('unsigned long' versus 'unsigned long long'
above).
Cygwin uses newlib and I checked the documentation on the newlib homepage:
It provides both the 'unsigned long' and the 'unsigned long long' version.
Also cygwin/gcc allows to use 'unsigned long long' variables.  So it's not
that everything related 64 bit is not available, because I'm compiling for
a 32bit Windows.  Is there a special option I should use to get access to
more 64 bit methods?

Here is a simple test program to show the effect:

#include <cstdlib>

int main(int argc, char** argv)
{
    unsigned long long l = 0;

    l = std::strtoull("0x100", NULL, 16);

    return 0;
}


This is the call to the compiler:

$ g++ -Wall -o tt tt.cpp
tt.cpp: In function 'int main(int, char**)':
tt.cpp:7:9: error: 'strtoull' is not a member of 'std'


Here is my version of cygwin and gcc / g++:
CYGWIN_NT-5.1 XXXXXXXX 1.7.9(0.237/5/3) 2011-03-29 10:10 i686 Cygwin
g++ (GCC) 4.5.3



Mit freundlichen Grüßen / Kind regards

Markus Selve

zSeries I/O Firmware Developer
IBM Systems &Technology Group, Systems Software Development / i390 Firmware
Development
-------------------------------------------------------------------------------------------------------------------------------------------

IBM Deutschland
Schoenaicher Str. 220
71032 Boeblingen
Phone: +49-7031-16-5143
E-Mail: mselve at de.ibm.com
-------------------------------------------------------------------------------------------------------------------------------------------

IBM Deutschland Research & Development GmbH / Vorsitzender des
Aufsichtsrats: Martin Jetter
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart,
HRB 243294


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