Code::Blocks Forums
User forums => Help => Topic started by: rohan076 on September 27, 2006, 06:34:42 am
-
Hi,
I was developing a cryptographic application and I'll have to use the GMP library for it. now i use codeblocks for coding in C! how do i make use of the gmp library?? please help.
Thanks in advance,
Rohan. :shock:
-
It is not difficult. You can use the MSYS (see www.mingw.org) system. You can simply follow the usual
build procedure of the Unix world (./configure then make).
Read the installation instruction before running the configure command to understand which options are good for you.
I do suggest to run the tests after compilation, it is mandatory to verify the compilation. If you get errors you cannot
trust in the library. If you don't get errors... it is possible that gmp works.
If you have problems I can send you (without any responsability) my libs and includes.
Regards
Max.
-
i dont quiet understand!!! i'm new to all of this, in the gmp folder, there is a gmp.h file, i've included that in the header of my program, is there anything else i gotta set, cause i get errors while compiling the code. can you be more precise with your method. thanks in advace. 8)
-
When learning to program, learning how to use Google is the most important thing.
If you google for GMP library, the second hit you get is "GMP install instructions". That page not only describes exactly what you need to do to compile GMP with a variety of compilers, it also contains downloadable precompiled libraries which you can use right away.
-
hmm.......to tell u the truth i tried all of that, but nothing f*&(* works!!! its so frustrating!
-
hmm.......to tell u the truth i tried all of that, but nothing f*&(* works!!! its so frustrating!
It's hard to believe. Here is what I did:
1.) went to http://cs.nyu.edu/exact/core/gmp/ (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 (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 (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.
-
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
-
:lol: :lol:
-
I am windows user how can I do step number 3,5,7
Could you please explain more?
-
I am windows user how can I do step number 3,5,7
Could you please explain more?
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.
-
Doesn't work for me.
After I add nothing happened.