trying to get gmp running
David McKen
dmlmcken at comcast.net
Thu Aug 25 05:25:21 CEST 2005
You have to put a "-lgmp" on the command line (dash, lower case 'L',
leave out the "lib" prefix and ".a" suffix). You only need the upper
case 'L' if you installed gmp in an odd place that the compiler doesn't
automatically look in. Under cygwin you want to put the gmp.h & gmpxx.h
files in the same directory as stdio.h and string.h
(<something>/include) and the libgmp.a & libgmpxx.a in the same folder
as other .a files (don't know any standard ones offhand but it will be
<something>/lib)
Hope this helps
David McKen
Karlkneile at aol.com wrote:
> I am having problems getting gmp up and running. The description of
> my problem is both below and in the attached file. The attachment is
> a wordpad text file. I'm not certain which is the preferred mode in
> this forum. I'm sure I made a simple error, but I'm at a loss what to
> try next.
>
> I am trying to get gmp running on my system.
>
> cygwin ver 2.457.2.2 with windows XP.
> gcc-g++-3.4.4-1
> gmp-4.1.4
>
> gcc was downloaded and installed thru cygwin
> it appears to be working OK
>
> gmp was downloaded from swox
> I didn't find it at cygwin; is it there?
> gmp was installed using ./configure
> followed by a make
> make check gave all passes
>
> I tried the following program "progname"
>
> #include <stdio.h>
> #include <gmp.h>
>
> main()
> {
> mpz_t n;
> mpz_init(n);
> }
>
> c++ -I/gmp-4.1.4 progname
>
> I had to use the -I option for c++ to find the gmp.h file
> Could I have installed it differently to avoid this?
>
> The above resulted the error: undefined reference to '___gmpz_int'
> I tried using -L/libgmp.la without any change
>
> What am I doing wrong?
> Is there a better way to install gmp?
> I am not a systems person; just a c++ user that would like to have gmp.
>
>------------------------------------------------------------------------
>
>I am trying to get gmp running on my system.
>
>cygwin ver 2.457.2.2 with windows XP.
>gcc-g++-3.4.4-1
>gmp-4.1.4
>
>gcc was downloaded and installed thru cygwin
>it appears to be working OK
>
>gmp was downloaded from swox
> I didn't find it at cygwin; is it there?
>gmp was installed using ./configure
>followed by a make
>make check gave all passes
>
>I tried the following program "progname"
>
> #include <stdio.h>
> #include <gmp.h>
>
> main()
> {
> mpz_t n;
> mpz_init(n);
> }
>
>c++ -I/gmp-4.1.4 progname
>
>I had to use the -I option for c++ to find the gmp.h file
> Could I have installed it differently to avoid this?
>
>The above resulted the error: undefined reference to '___gmpz_int'
>I tried using -L/libgmp.la without any change
>
>What am I doing wrong?
>Is there a better way to install gmp?
>I am not a systems person; just a c++ user that would like to have gmp.
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>gmp-discuss mailing list
>gmp-discuss at swox.com
>https://gmplib.org/mailman/listinfo/gmp-discuss
>
>
More information about the gmp-discuss
mailing list