win32 _decl problems

Fredrik Karlsson x_fka@sectra.se
Fri, 1 Aug 2003 09:09:32 +0200


Hi all!

After browsing through the archives it seems that alot of problems are
associated with Win32 usage of MP.
In fact, so does mine. And despite all previous questions and answers I
still cannot get things going...

I am using DeltaTrinity's ready-compiled DLL and Visual C++ 6.
My problems is related to using the functions in my own program.

After reading some previous posts I understand that I must use _cdecl.
I have written for example the following:

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".
Other error messages I have seen are related to linking - but I assume these
are caused by not properly using the _cdecl.

So, I do I *properly* use the DLL? Perhaps some samle code?
I am not a very experienced C-programmer, so please explain in reasonable
detail if you wish to help me.

Thanks in advance/

Fredrik Karlsson