I tried to compile qperft by H.G.Muller with Visual C++2008 and I get the error
unresolved external symbol _lltoa
I wonder how do I fix this error and what does the folowing code does.
lltoa(count-ocnt, buf, 10);
lltoa(count, buf, 10);
compiling qperft by H.G.Muller mistake
Moderator: Ras
-
- Posts: 10892
- Joined: Thu Mar 09, 2006 12:37 am
- Location: Tel-Aviv Israel
-
- Posts: 4718
- Joined: Wed Oct 01, 2008 6:33 am
- Location: Regensburg, Germany
- Full name: Guenther Simon
Re: compiling qperft by H.G.Muller mistake
Seems to be a typo. Try itoa.Uri Blass wrote:I tried to compile qperft by H.G.Muller with Visual C++2008 and I get the error
unresolved external symbol _lltoa
I wonder how do I fix this error and what does the folowing code does.
lltoa(count-ocnt, buf, 10);
lltoa(count, buf, 10);
-
- Posts: 481
- Joined: Thu Apr 16, 2009 12:00 pm
- Location: Slovakia, EU
Re: compiling qperft by H.G.Muller mistake
Try to replace with
Edit: lowercase letter "L"
Code: Select all
sprintf(buf,"%lld",count);
-
- Posts: 2284
- Joined: Fri Jul 14, 2006 7:56 am
- Location: London, England
- Full name: Jim Ablett
Re: compiling qperft by H.G.Muller mistake
Uri Blass wrote:I tried to compile qperft by H.G.Muller with Visual C++2008 and I get the error
unresolved external symbol _lltoa
I wonder how do I fix this error and what does the folowing code does.
lltoa(count-ocnt, buf, 10);
lltoa(count, buf, 10);
replace all instances >
lltoa with ltoa
Jim.
-
- Posts: 1922
- Joined: Thu Mar 09, 2006 12:51 am
- Location: Earth
Re: compiling qperft by H.G.Muller mistake
Neither itoa nor ltoa should be used, but rather the %llu format in printf. itoa and ltoa take a long int, which in 32-bit environments should only be 32 bits. %llu takes a long long. It's also easier to use the %llu since there's already a printf there.Uri Blass wrote:I tried to compile qperft by H.G.Muller with Visual C++2008 and I get the error
unresolved external symbol _lltoa
I wonder how do I fix this error and what does the folowing code does.
lltoa(count-ocnt, buf, 10);
lltoa(count, buf, 10);
EDIT: I changed it to %llu instead of %lld, in case a perft value gets over 9 quintillion

-
- Posts: 28389
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: compiling qperft by H.G.Muller mistake
On the compiler I was using at the time, (gcc/Cygwin) %lld did not work. lltoa (= long long int to ascii) was the only way I could find to print a long long int.
-
- Posts: 260
- Joined: Sat Mar 11, 2006 8:31 am
- Location: Malmö, Sweden
- Full name: Bo Persson
Re: compiling qperft by H.G.Muller mistake
Microsoft calls their 64 bit type __int64, so the function is called _i64toa.Uri Blass wrote:I tried to compile qperft by H.G.Muller with Visual C++2008 and I get the error
unresolved external symbol _lltoa
I wonder how do I fix this error and what does the folowing code does.
lltoa(count-ocnt, buf, 10);
lltoa(count, buf, 10);