win32 _decl problems

delta trinity
Fri, 01 Aug 2003 09:11:47 -0400

Hello Fredrick

Well, I think it's easier to simply use the gmp.h functions.  Visual Studio 
should automatically detect (from the .lib) that the calls are cdecl.

If you have already included 'gmp.h', you may get an error if you try to 
re-define the functions.


>From: "Fredrik Karlsson" <>
>To: <>
>Subject: win32 _decl problems
>Date: 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 
>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
>gmp-discuss mailing list

Protect your PC - get VirusScan Online