bug-gmp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Installing GMP on cygwin


From: Edward Marti
Subject: RE: Installing GMP on cygwin
Date: Thu, 20 Jun 2002 17:02:40 -0700

I have installed mingw on my computer, and tried to do the recommended mingw
build. The errors from compiling the GMP-powered program encode.cpp are as
follows:

address@hidden ~/programming
$ g++ encode.cpp -lgmpxx -lgmp -mno-cygwin -o encode
/cygdrive/c/WINDOWS/TEMP/ccKRXDXV.o(.text$__ls__H3ZcZt18string_char_traits1Z
cZt2
4__default_alloc_template2b0i0_R7ostreamRCt12basic_string3ZX01ZX11ZX21_R7ost
ream
+0x32):encode.cpp: undefined reference to `ostream::write(char const *,
long)'
/usr/lib/mingw/libgmpxx.a(osdoprnti.o): In function
`$_20gmp_allocated_string':
/home/Ed/gmp-4.0.1/cxx/../gmp-impl.h:2503: undefined reference to
`ostream::writ
e(char const *, long)'
/usr/lib/mingw/libgmp.a(set_str.o): In function `digit_value_in_base':
/home/Ed/gmp-4.0.1/mpz/set_str.c:38: undefined reference to `_imp___ctype_'
/usr/lib/mingw/libgmp.a(set_str.o): In function `_gmpz_set_str':
/home/Ed/gmp-4.0.1/mpz/set_str.c:64: undefined reference to `_imp___ctype_'
/home/Ed/gmp-4.0.1/mpz/set_str.c:101: undefined reference to `_imp___ctype_'
/home/Ed/gmp-4.0.1/mpz/set_str.c:101: undefined reference to `_imp___ctype_'
/home/Ed/gmp-4.0.1/mpz/set_str.c:118: undefined reference to `_imp___ctype_'
/usr/lib/mingw/libgmp.a(assert.o): In function `_gmp_assert_header':
/home/Ed/gmp-4.0.1/assert.c:37: undefined reference to `_impure_ptr'
/home/Ed/gmp-4.0.1/assert.c:39: undefined reference to `_impure_ptr'
/usr/lib/mingw/libgmp.a(assert.o): In function `_gmp_assert_fail':
/home/Ed/gmp-4.0.1/assert.c:48: undefined reference to `_impure_ptr'
collect2: ld returned 1 exit status

address@hidden ~/programming
$

Any recommendations?

 - Edward Marti

-----Original Message-----
From: Kevin Ryde [mailto:address@hidden
Sent: Wednesday, June 19, 2002 4:05 PM
To: Edward Marti
Cc: address@hidden
Subject: Re: Installing GMP on cygwin


"Edward Marti" <address@hidden> writes:
>
> When I originally installed GMP on my linux distro (Red Hat 7.3), I had
> trouble having the programs compile, even after adding the '-lgmp' or
> '-lgmpxx' endings. Eventually, I discovered that if I installed the
programs
> with --prefix=/usr instead of /usr/local, it would work with no problems.

I can never remember if /usr/local is searched by the compiler and/or
loader.  You can use compiler options (on your application) to look
anywhere desired.

If it's just a shared library which is not found you might need to
re-run ldconfig (though the libtool install is supposed to do that
already).

> BTW, is there a way to install GMP under mingw? I have found that mingw
has
> much nicer executables because it doesn't require a dll like cygwin1.dll.
> However, all the GMP files, such as 'configure', are in linux, and my
mingw
> won't seem to run them.

With the mingw tools it should be possible to run configure in the
normal way.

It might be possible to do a mingw build using the cygwin tools too,
something like the following (untested),

        ./configure CC="gcc -mno-cygwin" --host=i386-pc-mingw32

Replace i386 with your actual processor.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]