[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gmp] a very simple example

From: Kevin Ryde
Subject: Re: [Bug-gmp] a very simple example
Date: 05 Aug 2000 08:28:09 +1000
User-agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.5

Ferdinand Moldenhauer <address@hidden> writes:
> #include "d:\gmp-3.0\gmp.h"
> int main()
> {
>   mpz_t aa, bb, cc;
>   mpz_init( aa );  mpz_init( bb );  mpz_init( cc );
>   mpz_add( cc, aa, bb );
>   mpz_out_str( stdout, 36, cc );
>   mpz_clear( aa ), mpz_clear( bb ); mpz_clear( cc );
>   return 0;
> } // main

You need to store values into aa and bb, perhaps using mpz_set_str,
this code probably prints "0".

> Which files have to be included in the project? I included almost all of
> the C-source-files out of the directories MPZ and MPN/GENERIC. But it
> doesn't work.

You'll need mpn/mp_bases.c too, but it should work.

> I use WinNT and C (Microsoft VC 6.0, Borland C 5.0 and Borland Turbo C
> 3.1). None of them compiles the source.

Those compilers aren't supported directly, though they can be expected
to work and some people have reported success with them.  On
DOS/Windows, cygwin and djgpp are recommended.

> Or do you have any idea to which usenet I should turn to?

There's a small gmp mailing list, see http://www.swox.com/gmp/ under
"Discussing GMP".  The question of gmp for msvc came up just recently.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]