compiling the billions of Pi digits.c file

Sisyphus sisyphus1 at optusnet.com.au
Mon Jul 17 09:10:51 CEST 2006


----- Original Message ----- 
From: "glassy" <glassymeow at yahoo.com>

> how to compile and build the file "gmp-chudnovsky.c"
> in the http://swox.com/gmp/pi-with-gmp.html
> i am not a programmer, just a user, i hope someone could give a detailed
insructions.
> i have failed in compiling the file using VC++ v6.0 under winows xp

It builds ok with the MinGW (native windows) port of the gcc compiler on
Win32, but when I try to build with VC7.0, I get the following
warnings/errors during compilation:

gmp-chudnovsky.c(176) : warning C4005: 'min' : macro redefinition
        F:\vsnet\Vc7\include\stdlib.h(415) : see previous definition of
'min'
gmp-chudnovsky.c(177) : warning C4005: 'max' : macro redefinition
        F:\vsnet\Vc7\include\stdlib.h(414) : see previous definition of
'max'
gmp-chudnovsky.c(211) : error C2054: expected '(' to follow 'inline'
gmp-chudnovsky.c(212) : error C2085: 'fac_reset' : not in formal parameter
list
gmp-chudnovsky.c(212) : error C2143: syntax error : missing ';' before '{'
gmp-chudnovsky.c(217) : error C2054: expected '(' to follow 'inline'
gmp-chudnovsky.c(218) : error C2085: 'fac_init_size' : not in formal
parameter list
gmp-chudnovsky.c(218) : error C2143: syntax error : missing ';' before '{'
gmp-chudnovsky.c(230) : error C2054: expected '(' to follow 'inline'
gmp-chudnovsky.c(231) : error C2085: 'fac_init' : not in formal parameter
list
gmp-chudnovsky.c(231) : error C2143: syntax error : missing ';' before '{'
gmp-chudnovsky.c(236) : error C2054: expected '(' to follow 'inline'
gmp-chudnovsky.c(237) : error C2085: 'fac_clear' : not in formal parameter
list
gmp-chudnovsky.c(237) : error C2143: syntax error : missing ';' before '{'
gmp-chudnovsky.c(242) : error C2054: expected '(' to follow 'inline'
gmp-chudnovsky.c(243) : error C2085: 'fac_resize' : not in formal parameter
list

gmp-chudnovsky.c(243) : error C2143: syntax error : missing ';' before '{'
gmp-chudnovsky.c(252) : error C2054: expected '(' to follow 'inline'
gmp-chudnovsky.c(253) : error C2085: 'fac_set_bp' : not in formal parameter
list

gmp-chudnovsky.c(253) : error C2143: syntax error : missing ';' before '{'
gmp-chudnovsky.c(266) : error C2054: expected '(' to follow 'inline'
gmp-chudnovsky.c(267) : error C2085: 'fac_mul2' : not in formal parameter
list
gmp-chudnovsky.c(267) : error C2143: syntax error : missing ';' before '{'
gmp-chudnovsky.c(299) : error C2054: expected '(' to follow 'inline'
gmp-chudnovsky.c(300) : error C2085: 'fac_mul' : not in formal parameter
list
gmp-chudnovsky.c(300) : error C2143: syntax error : missing ';' before '{'
gmp-chudnovsky.c(311) : error C2054: expected '(' to follow 'inline'
gmp-chudnovsky.c(312) : error C2085: 'fac_mul_bp' : not in formal parameter
list

gmp-chudnovsky.c(312) : error C2143: syntax error : missing ';' before '{'
gmp-chudnovsky.c(319) : error C2054: expected '(' to follow 'inline'
gmp-chudnovsky.c(320) : error C2085: 'fac_compact' : not in formal parameter
list
gmp-chudnovsky.c(320) : error C2143: syntax error : missing ';' before '{'

I think these errors all stem from the fact that VC7.0 (and, I assume,
VC6.0) expect a '(' to follow 'inline'. I don't know, offhand, how to
rewrite that code in such a way that Microsoft compilers will find it
acceptable ... and it's something that's off-topic for this list. Perhaps
some kind soul who knows the answer will tell you anyway :-)
Otherwise you could ask for advice on how to handle this situation at (eg)
the comp.os.ms-windows.programmer.misc newsgroup where (I think) such
questions *are* on topic.

If the error you get is significantly different to the above, then it might
be best to let us know just what the error is.

Cheers,
Rob



More information about the gmp-discuss mailing list