[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problems linking with gmp...
From: |
Will Galway |
Subject: |
Re: Problems linking with gmp... |
Date: |
Wed, 11 Sep 2002 20:04:06 -0700 (PDT) |
Kevin Ryde writes:
> Will Galway <address@hidden> writes:
> >
> > > cc gmp-test.c -I/home/users/galway/include -L/home/users/galway/lib
> > -lgmp -o gmp-test
> > Undefined first referenced
> > symbol in file
> > __gmp_printf gmp-test.o
> > ld: fatal: Symbol referencing errors. No output written to gmp-test
>
> If that's the only symbol missing, ie. it found the others, then
> perhaps you're hitting an older libgmp, pre-dating gmp_printf. I
> don't know why that would happen if the -L is right. Maybe adding -V
> or -Wl,-V for verbose output would show what's going on.
Well, it took me quite awhile, but I think I now understand what was
going wrong.
There >>is<< an "older libgmp" that is being hit, on /usr/local/lib/,
which has a vintage 3.1 libgmp installed. However, as you note, I'd
expect my -L to override that. HOWEVER, there seems to be some issue
as to what architecture I'm compiling for, the default when running cc
is NOT "-xarch=v9". (I'm not sure what the corresponding gcc
construct is.)
So, when I compile my test program without "-xarch=v9", at link time
ld "correctly" decides to link to the older libgmp, compiled without
"-xarch=v9".
If, I instead compile using
cc -xarch=v9 gmp-test.c -I/home/users/galway/include -L/home/users/galway/lib
-lgmp -o gmp-test
things work great. So, I guess it was a "simple" problem, but not
quite as simple as I'd first thought!
Thanks!
--Will
( mailto:address@hidden http://www.cecm.sfu.ca/~wfgalway )
- Problems linking with gmp..., Will Galway, 2002/09/11
- Re: Problems linking with gmp..., Kevin Ryde, 2002/09/11
- Re: Problems linking with gmp...,
Will Galway <=
- Re: Problems linking with gmp..., Kevin Ryde, 2002/09/13
- Re: Problems linking with gmp..., Will Galway, 2002/09/13
- Re: Problems linking with gmp..., Torbjorn Granlund, 2002/09/13
- Re: Good GMP performance (WAS Re: Problems linking with gmp...), Will Galway, 2002/09/13
- Re: Good GMP performance (WAS Re: Problems linking with gmp...), Torbjorn Granlund, 2002/09/13
- Re: Good GMP performance (WAS Re: Problems linking with gmp...), Will Galway, 2002/09/13
- Re: Good GMP performance (WAS Re: Problems linking with gmp...), Kevin Ryde, 2002/09/13