User forums > Help

Install GMP library with codeblocks

<< < (2/3) > >>

MortenMacFly:

--- Quote from: rohan076 on September 29, 2006, 04:58:13 am ---hmm.......to tell u the truth i tried all of that, but nothing f*&(* works!!! its so frustrating!

--- End quote ---
It's hard to believe. Here is what I did:
1.) went to http://cs.nyu.edu/exact/core/gmp/
2.) downloaded the GMP-MinGW-package (http://cs.nyu.edu/exact/core/gmp/gmp-static-mingw-4.1.tar.gz)
3.) extracted to a temp folder
4.) downloaded http://cs.nyu.edu/exact/core/gmp/gmp-4.1.tar.gz
5.) extracted to another temp folder to get the example [GMP-Folder]\demos\primes.c
6.) created a C console project with this as "main.c" file
7.) went to the build options of this project and:
- linker: add library "gmp" (without quotation marks)
- directories - compiler: added [GMP-MinGW-package]\include
- directories - linker: added [GMP-MinGW-package]\lib
8.) pressed "build & run".
--> 1..2..3 - everything works.
With regards, Morten.

rohan076:
thanks a lot, it worked perfect!!

can you give me some gmp help then?? please
i'm trying to generate a random number and this is what i did

gmp_randstate_t state;
int gmp_randinit_mt(state);
mpz_t rop;
mpz_init(rop);
mpz_urandomm (rop, state, N);
gmp_printf("\nS = %Zd\n", rop);

I dont see any output!!! N is 2^50

bluekid:
 :lol: :lol:

Hamed:
I am windows user how can I do step number 3,5,7
Could you please explain more?

stahta01:

--- Quote from: Hamed on November 20, 2010, 10:43:05 am ---I am windows user how can I do step number 3,5,7
Could you please explain more?

--- End quote ---

For steps 3 and 5; install 7Zip and right click on file use extract here.
right click on the new .tar file and use "extract to ..." or "extract here" the best choose varies.

7. went to the build options of this project
A. Project -> Build Options
- linker: add library "gmp" (without quotation marks)
A1. Tab: Linker Settings Subtab: Link Lib..
- directories - compiler: added [GMP-MinGW-package]\include
A2. Tab: Search Directory Subtab:Compiler
- directories - linker: added [GMP-MinGW-package]\lib
A3. Tab: Search Directory Subtab:Linker

Tim S.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version