Alexander Hansen wrote: > On Mar 30, 2008, at 7:23 PM, S. Newhouse wrote: > > >> Hello, >> I am running Mac OSX 10.4.11 >> I tried to install gmp and mpfr and get the following error messages >> when trying to compile a simple example. >> >> >> >> /usr/bin/ld: Undefined symbols: >> ___gmpfr_out_str >> _mpfr_add >> _mpfr_clear >> _mpfr_div >> _mpfr_init2 >> _mpfr_mul_ui >> _mpfr_set_d >> collect2: ld returned 1 exit status >> >> Any ideas? >> TIA, >> -sen >> . >> >> . >> >> > > What architecture are you on? Also, can you provide the last line the > compiler tried to run before the undefined symbols showed up? > > . > >
I am running on a MacBook Pro [EMAIL PROTECTED] MPFR]$ uname -a Darwin basie 8.11.1 Darwin Kernel Version 8.11.1: Wed Oct 10 18:23:28 PDT 2007; root:xnu-792.25.20~1/RELEASE_I386 i386 i386 I installed mpfr with fink. [EMAIL PROTECTED] MPFR]$ fink list | grep mpfr libmpfr-dev 2.1.0-1 C library for multiple-precision floating-point computations i libmpfr1 2.2.1-3 C library for floating-point computation libmpfr1-64bit 2.2.1-3 -64bit C library for floating-point computation libmpfr1-64bit-shlibs 2.2.1-3 Shared libraries for mpfr package i libmpfr1-shlibs 2.2.1-3 Shared libraries for mpfr package [EMAIL PROTECTED] MPFR]$ fink list | grep gmp i gmp 4.2.1-1008 GNU multiple precision arithmetic library gmp-64bit 4.2.1-1008 GNU multiple precision arithmetic library gmp-64bit-shlibs 4.2.1-1008 Shared library for gmp package i gmp-shlibs 4.2.1-1008 Shared library for gmp package libgmpxx4-64bit-shlibs 4.2.1-1008 Shared C++ library for gmp package i libgmpxx4-shlibs 4.2.1-1008 Shared C++ library for gmp package php4-apache2-ssl-gmp 4.4.2-14 HTML-embedded server-side scripting language php4-gmp 4.4.2-14 GNU MP module for php4 php5-apache2-ssl-gmp 5.1.4-17 HTML-embedded server-side scripting language php5-gmp 5.1.4-17 GNU MP module for php5 [EMAIL PROTECTED] MPFR]$ I simply tried the standard example which comes with mpfr called sample.c Here is the code and here is that attempt to compile it. #include <stdio.h> #include <gmp.h> #include <mpfr.h> int main (void) { unsigned int i; mpfr_t s, t, u; mpfr_init2 (t, 200); mpfr_set_d (t, 1.0, GMP_RNDD); mpfr_init2 (s, 200); mpfr_set_d (s, 1.0, GMP_RNDD); mpfr_init2 (u, 200); for (i = 1; i <= 100; i++) { mpfr_mul_ui (t, t, i, GMP_RNDU); mpfr_set_d (u, 1.0, GMP_RNDD); mpfr_div (u, u, t, GMP_RNDD); mpfr_add (s, s, u, GMP_RNDD); } printf ("Sum is "); mpfr_out_str (stdout, 10, 0, s, GMP_RNDD); putchar ('\n'); mpfr_clear (s); mpfr_clear (t); mpfr_clear (u); return 0; } [EMAIL PROTECTED] MPFR]$ cc -o sample sample.c -lmpfr /usr/bin/ld: Undefined symbols: ___gmpfr_out_str _mpfr_add _mpfr_clear _mpfr_div _mpfr_init2 _mpfr_mul_ui _mpfr_set_d collect2: ld returned 1 exit status [EMAIL PROTECTED] MPFR]$ Note: This works fine in linux (Fedora Core 6). Thanks for any ideas, -sen ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ Fink-users mailing list Fink-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fink-users