1833750 Members
2538 Online
110063 Solutions
New Discussion

Strtoll

 
patilvikram
New Member

Strtoll

I could not find strtoll in my include files from aC+ compiler.

I need that function for compiling some code which used 11.11

uname -a
HP-UX dev5-hp B.11.23 U 9000/800 151951587

I am not definitely running under Tru64 Unix
5 REPLIES 5
Steven Schweda
Honored Contributor

Re: Strtoll

> I could not find strtoll in my include
> files from aC+ compiler.

Why were you looking?

> [...] 11.11 [...]

> [...] B.11.23 [...]

Huh?

> I am not definitely running under Tru64
> Unix

Yeah, the "HP-UX" pretty well revealed that.

It seems to exist in 11.23 (though not in
11.11):

http://docs.hp.com/en/B2355-60103/strtol.3C.html

If you insist on remaining in the stone age,
then I'd expect that a Web search for, say,
strtoll.c
would locate some relatively unencumbered
source code which you could steal.

Portable code tends to deal with this kind of
thing at the "./configure" stage. My psychic
powers are too weak to tell me what you're
doing, so it's hard to offer much specific
advice.
Dennis Handly
Acclaimed Contributor

Re: strtoll

>I could not find strtoll in my include files from aC++ compiler.

This C99 function isn't there until 11.23 and only because I requested it.

On 11.11 you can use and strtoimax but you'll need to change for 11.23.

patilvikram
New Member

Re: Strtoll

I am quite confused about replied.

I am currently running under 11.23 . But the compiler I am using is aC++ compiler.
So my code should be atleast supported on 11.23

lets say test.cc is trying to use strtoull / strtoll

I should be able to to compile it with

aCC -c test.cc

where as I got following error

"test.cc", line 20 # Undeclared variable 'strtoull'. Perhaps 'strtoul' as in "unsigned long strtoul(const char *,char **,int)" ["/usr/include/stdlib.h", line 169] was intended.

Is there any specific option I need to provide for compiler to use this function


Steven Schweda
Honored Contributor

Re: Strtoll

> I am quite confused about replied.

That's fair. I was confused by the question.

> I am currently running under 11.23 .

So, why did you bring "11.11" into this?

> lets say test.cc is trying to use strtoull
> / strtoll

Say anything you want. My psychic powers are
too weak to let me see what's in your
"test.cc" without some help from you. If
it's not a State Secret, perhaps you could
show us all what's in your "test.cc"?

"man strtoll". Did you:

#include

as suggested there? I know nothing, but I'd
guess that if the compiler had seen
, then it wouldn't say anything
like:

Perhaps 'strtoul' as in "unsigned long
strtoul(const char *,char **,int)"
["/usr/include/stdlib.h", line 169] was
intended.

But why should I need to guess?
Dennis Handly
Acclaimed Contributor

Re: strtoll

>I am quite confused about replied.

Oops, I assumed you wanted strtoll on 11.11 and it worked for you on 11.23.

>Is there any specific option I need to provide for compiler to use this function

You need to use -ext.

>Steven: "man strtoll"

Unfortunately the man page just says "C99" with no details on what magic is needed to call it.

>Did you: #include <stdlib.h> as suggested there?

Of course, otherwise the compiler wouldn't have mentioned <stdlib.h>. The only advanced AI technology in the the compiler is to look for a symbol close to the undefined variable, not to guess where it should be.

The aC++ suggestion was that it found strtoul in stdlib.h but not strtoull.