win32 _decl problems

Kevin Ryde user42@zip.com.au
Sat, 02 Aug 2003 07:17:53 +1000


"Fredrik Karlsson" <x_fka@sectra.se> writes:
>
> extern "C" {
> 	void _cdecl mpz_init(mpz_t integer);
> 	void _cdecl mpz_set_str(mpz_t rop, char *str, int base);
> }
>
> ....
>
> mpz_set_str(g, gstr, 16);
>
> The error I get tells me that "second C linkage of overloaded function
> '__gmpz_set_str' not allowed".

You added an extra prototype for mpz_set_str on top of what's in
gmp.h?  The difference between the two is likely to be provoking the
error.

You're probably best off leaving the compiler in the default cdecl
mode.  If you really want stdcall or fastcall on your own functions
you can give it explicitly.