mersenneforum.org Where I should write C code (thread moved)
 Register FAQ Search Today's Posts Mark Forums Read

2006-05-02, 10:02   #1
maqableh

May 2006
Malaysia

3 Posts
Where I should write C code (thread moved)

Quote:
Thank you for your Explaining how to install the Library Step-by-Step

Please can Anyone tell me where I should write the C Code.
After I did all the step I have only Msys in the start menu
So I intalled the MinGW Developer Studio, then I wrote the simple C Code
like this :

#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include<C:\GNU\1.0\home\Mahmoud Maqableh\gmp-4.1\gmp.h>
#include<conio.h>

int main()
{
mpf_t r;
mpf_init(r);

printf("\n\t The valuse of Xn = %F",r);

mpf_clear (r);
return 0;
}

When I do the Compile there is no any Error, but if I do Run
I have 2 Errors:
H:\Simple.c:16: undefined reference to __gmpf_init'
H:\Simple.c:21: undefined reference to __gmpf_clear'

Can Anyone Help me to eliminate these Errors.
My E-mail : Maqableh_cs@yahoo.com
Mahmoud Maqableh, Balila

 2006-05-03, 06:33 #2 maqableh   May 2006 Malaysia 310 Posts Please I need the Help urgent. Helllo Everyone I want to install GMP Library on windows XP, I did that but I have problem I did the Installation like this : 1) Download the current Mingw http://prdownloads.sf.net/mingw/MinG...1.exe?download and MSYS http://prdownloads.sf.net/mingw/MSYS...0.exe?download 2) I made a folder called GNU and installed MinGW in c:\GNU\MinGW 3) I installed MSYS in c:\GNU\msys Now you get an icon on the desktop where you can start the MinSys. Do this, because is creates your home folder. Then exit it again. 4) Download gmp and place it in your newly created home folder. (For me is was called C:\GNU\msys\1.0\home\Maqableh ) 5) Start the MinSys up again from the desktop and type gunzip gmp-4.1.4.tar.gz tar -xvf gmp-4.1.4.tar cd gmp-4.1.4 ./configure make install Please can Anyone tell me where I should write the C Code. After I did all the step I have only Msys.exe in the start menu So I intalled the MinGW Developer Studio, then I wrote the simple C Code like this : #include #include #include #include #include int main() { mpf_t r; mpf_init(r); printf("\n\t The valuse of Xn = %F",r); mpf_clear (r); return 0; }When I do the Compile there is no any Error, but if I do Run I have 2 Errors: H:\Simple.c:16: undefined reference to __gmpf_init' H:\Simple.c:21: undefined reference to __gmpf_clear' I do not know what was the problem. Can Anyone Help me to eliminate these Errors."correct the Linking Error" OR send to me Step-by-step How I can install GMP-4.2 on Windows XP and do Run to the previous Code. Please I need the Help urgent. Note: My PC CPU is : Intel(R) Celeron CPU 2.4GHzis it compatible with Intel P4???? I think GMP do not work with any CPU!!!!!!! My E-mail : Maqableh_cs@yahoo.com Mahmoud Maqableh, Balila
 2006-05-03, 06:39 #3 maqableh   May 2006 Malaysia 3 Posts Please I need the Help urgent. Helllo Everyone I want to install GMP Library on windows XP, I did that but I have problem I did the Installation like this : 1) Download the current Mingw http://prdownloads.sf.net/mingw/MinG...1.exe?download and MSYS http://prdownloads.sf.net/mingw/MSYS...0.exe?download 2) I made a folder called GNU and installed MinGW in c:\GNU\MinGW 3) I installed MSYS in c:\GNU\msys Now you get an icon on the desktop where you can start the MinSys. Do this, because is creates your home folder. Then exit it again. 4) Download gmp and place it in your newly created home folder. (For me is was called C:\GNU\msys\1.0\home\Maqableh ) 5) Start the MinSys up again from the desktop and type gunzip gmp-4.1.4.tar.gz tar -xvf gmp-4.1.4.tar cd gmp-4.1.4 ./configure make install Please can Anyone tell me where I should write the C Code. After I did all the step I have only Msys.exe in the start menu So I intalled the MinGW Developer Studio, then I wrote the simple C Code like this : #include #include #include #include #include int main() { mpf_t r; mpf_init(r); printf("\n\t The valuse of Xn = %F",r); mpf_clear (r); return 0; } When I do the Compile there is no any Error, but if I do Run I have 2 Errors: H:\Simple.c:16: undefined reference to __gmpf_init' H:\Simple.c:21: undefined reference to __gmpf_clear' I do not know what was the problem. Can Anyone Help me to eliminate these Errors."correct the Linking Error" OR send to me Step-by-step How I can install GMP-4.2 on Windows XP and do Run to the previous Code. Please I need the Help urgent. Note: My PC CPU is : Intel(R) Celeron CPU 2.4GHz is it compatible with Intel P4???? I think GMP do not work with any CPU!!!!!!! My E-mail : Maqableh_cs@yahoo.com Mahmoud Maqableh, Balila
 2006-05-03, 06:54 #4 akruppa     "Nancy" Aug 2002 Alexandria 9A316 Posts Posts moved, they don't relate to GMP-ECM 6.0. Alex
 2006-05-03, 07:39 #5 ColdFury     Aug 2002 26×5 Posts You have to link with the GMP library. If you're using the command-line, try adding -lgmp
 2006-05-05, 04:44 #6 Marten   May 2006 USA 28 Posts How to multipy Two Big numbers using GMP Hello, Please, Can I ask you question???? I am using GMP library, and I want to multiply two big numbers each one consist of 160-bit. One of these numbers should be less than 1. Example : A=12345678901234567890123456789012345678901234567890. B=0.12345678901234567890123456789012345678901234567890. I tried to do the following but I can not successed. void multip { mpf_t A,B; mpf_init2(A,160); mpf_init2(B,160); mpf_set (A,12345678901234567890123456789012345678901234567890); mpf_set (B,0.12345678901234567890123456789012345678901234567890); gmp_printf("\n\t The valuse of A n = %Ff ",A); gmp_printf("\n\t The valuse of A n = %Ff ",B); mpf_clear (A); mpf_clear (B); } The compile Result: chaos.c: In function main': chaos.c:25: warning: integer constant is too large for this configuration of the compiler - truncated to 64 bits chaos.c:25: warning: decimal constant is so large that it is unsigned chaos.c:25: warning: passing arg 2 of __gmpf_set' makes pointer from integer without a cast chaos.c:71:3: warning: no newline at end of file if I want to see the chaos.exe I can not, and told me you should close theprogram. Please Can you tell me how to do assignment to those variable, and how to multipy like this big numbers. Thanks in Advans Marten,
 2006-05-05, 04:53 #7 Marten   May 2006 USA 210 Posts How to multipy Two Big numbers using GMP How to multipy Two Big numbers using GMP ------------------------------------------------------------------------- Hello, Please, Can I ask you question???? I am using GMP library, and I want to multiply two big numbers each one consist of 160-bit. One of these numbers should be less than 1. Example : A=12345678901234567890123456789012345678901234567890. B=0.12345678901234567890123456789012345678901234567890. I tried to do the following but I can not successed. void multip { mpf_t A,B; mpf_init2(A,160); mpf_init2(B,160); mpf_set (A,12345678901234567890123456789012345678901234567890); mpf_set (B,0.12345678901234567890123456789012345678901234567890); gmp_printf("\n\t The valuse of A n = %Ff ",A); gmp_printf("\n\t The valuse of A n = %Ff ",B); mpf_clear (A); mpf_clear (B); } The compile Result: chaos.c: In function main': chaos.c:25: warning: integer constant is too large for this configuration of the compiler - truncated to 64 bits chaos.c:25: warning: decimal constant is so large that it is unsigned chaos.c:25: warning: passing arg 2 of __gmpf_set' makes pointer from integer without a cast chaos.c:71:3: warning: no newline at end of file if I want to see the chaos.exe I can not, and told me you should close theprogram. Please Can you tell me how to do assignment to those variable, and how to multipy like this big numbers. Thanks in Advans Marten, Last fiddled with by akruppa on 2006-05-05 at 09:29 Reason: Post merged with your earlier thread.
 2006-05-05, 09:34 #8 akruppa     "Nancy" Aug 2002 Alexandria 2,467 Posts Try the GMP manual at http://www.swox.com/gmp/manual/, especially the "Basics: What every GMP user should know" section. Alex Last fiddled with by akruppa on 2006-05-05 at 09:34
 2006-05-05, 18:31 #9 ColdFury     Aug 2002 32010 Posts You can't use literals that big. Use the functions that accept strings.
 2006-05-12, 16:22 #10 ValerieVonck     Mar 2004 Belgium 7·112 Posts FWIW, in Java you can use the BigInteger Class (java.lang.math.BigInteger) Regards Cedric

 Similar Threads Thread Thread Starter Forum Replies Last Post Christenson Soap Box 161 2022-06-29 19:34 schickel Aliquot Sequences 10 2012-05-22 10:50 c10ck3r Lounge 10 2012-05-18 06:02 ET_ Operation Billion Digits 10 2008-09-17 12:28 ewmayer Operation Billion Digits 27 2006-11-03 08:05

All times are UTC. The time now is 23:03.

Tue Jul 5 23:03:21 UTC 2022 up 82 days, 21:04, 0 users, load averages: 0.76, 1.09, 1.16