compiling qperft by H.G.Muller mistake

Discussion of chess software programming and technical issues.

Moderator: Ras

Uri Blass
Posts: 10892
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

compiling qperft by H.G.Muller mistake

Post by Uri Blass »

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);
Guenther
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

Post by Guenther »

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);
Seems to be a typo. Try itoa.
User avatar
rvida
Posts: 481
Joined: Thu Apr 16, 2009 12:00 pm
Location: Slovakia, EU

Re: compiling qperft by H.G.Muller mistake

Post by rvida »

Try to replace with

Code: Select all

sprintf(buf,"%lld",count);
Edit: lowercase letter "L"
User avatar
Jim Ablett
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

Post by Jim Ablett »

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.
User avatar
Zach Wegner
Posts: 1922
Joined: Thu Mar 09, 2006 12:51 am
Location: Earth

Re: compiling qperft by H.G.Muller mistake

Post by Zach Wegner »

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);
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.

EDIT: I changed it to %llu instead of %lld, in case a perft value gets over 9 quintillion :lol:
User avatar
hgm
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

Post by hgm »

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.
User avatar
Bo Persson
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

Post by Bo Persson »

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);
Microsoft calls their 64 bit type __int64, so the function is called _i64toa.