|
From: | Ragbir S. Chana |
Subject: | -lgmp not working, please help. |
Date: | Sat, 10 Jan 2004 12:42:40 -0600 |
I am using cygwin under Win2K, 5.00.2195, Service Pack 4
(just upgraded from SP3 yesterday but no change).
Name of the computer: mecury.
AMD Athlon Processor AT/AT COMPATIABLE.
523,740 KB RAM
cygwin was installed recently under the following
directory:
c:\cygwin
gmp is installed under gmp-4.1.2, as
follows:
C:\cygwin\usr\gmp-4.1.2
Also the PATHS appear OK to me.
address@hidden ~/programs
$ $PATH bash: /cygdrive/h/root/bin:/etc:/usr/gmp-4.1.2/.lib:/lib/gcc-lib/i686-pc-cygwin/ 3.2/include:/lib/gcc-lib/i686-pc-mingw32:/usr/local/bin:/usr/bin:/bin:/cygdrive/ g/oracle/9iDSHome/jdk/jre/bin/classic:/cygdrive/g/oracle/9iDSHome/jdk/jre/bin:/c ygdrive/g/oracle/9iDSHome/bin:/cygdrive/g/oracle/9iDSHome/jlib:/cygdrive/g/oracl e/ora92/bin:/cygdrive/c/Program: No such file or directory address@hidden
~/programs
$ When I try to link with gmp libraries, I get the following
message
address@hidden ~/programs $ gcc -o test1 test1.c -lgmp /usr/lib/gcc-lib/i686-pc-cygwin/3.2/../../../../i686-pc-cygwin/bin/ld: cannot fi nd -lgmp collect2: ld returned 1 exit status The listing of test1.c is as
follows:
#include
<stdio.h>
#include <gmp.h> main (int argc, char
**argv)
{ mpz_t a, b, p; /* Initialize and
assign a and b from base 10 strings in argv */
mpz_init_set_str (a, argv[1], 10); mpz_init_set_str (b, argv[2], 10); /* Initialize p */ mpz_init (p); /* Multiply a and b
and put the result in p */
mpz_mul (p, a, b); /* Print p in base
10 */
mpz_out_str (stdout, 10, p); fputc ('\n', stdout); /* Since we're about
to exit, no need to clear out variables */
exit (0); } The feeling I am getting is that cygwin is not even aware that
there exists gmp installation. As far gmp installation itself, that appeared to
install successfully.
Do you think it was a mistake for me to install gmp at the present location
C:\cygwin\usr\gmp-4.1.2
or
do you think I should have installed under
C:\cygwin\usr\local\gmp-4.1.2 ????
Any help will be greatly greatly appreciated as I have already spent quite
some time with this baby. By the way simple hello.c works OK.
Thanks
Ragbir Chana
|
[Prev in Thread] | Current Thread | [Next in Thread] |