inline errors with gmp 4.2.4 (on Mac) - solution

Wade Williams wadesworld at mac.com
Fri Apr 17 20:41:32 CEST 2009


Joubert,

I just got around to testing this and it worked perfectly.  Thanks so  
much for the suggestion!

As you suggested, I just changed the C Language Dialect to gnu89.

Wade

On Mar 17, 2009, at 7:38 PM, Joubert Nel wrote:

> Hi Wade,
>
> I have also been struggling with the duplicate symbol ___gmp_abs  
> problem for the last day. But finally found a solution.
> The problem for me was not compiling GMP itself (I use Fink /  
> MacPorts), but rather my inclusion of its header file (gmp.h) - same  
> error message as you.
>
> The following Build settings for my Target in XCode did the trick:
> - C/C++ Compiler Version = GCC 4.2
> - C Language Dialect = C99 [-std=c99]
> - Other C flags: -fgnu89-inline
>
> Alternatively, if you simply compile with C Language Dialect set to  
> 89 (instead of 99), that should work too.
>
> Joubert
>
>
>
>
>
> inline errors with gmp 4.2.4
>
> Wade Williams wadesworld at mac.com
> Tue Jan 20 16:28:33 CET 2009
>
> Previous message: GMP can't handle leading plus sign?
> Next message: gmp 4.2.4 - mpf_add two large negative floats -  
> strange result
> Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> I've got one more problem with gmp for which I hope there's a  
> solution.
>
> I have spent long hours googling on this subject and trying the
> various suggestions presented, but so far none have worked.  I also
> have emailed Apple's XCode mailing list, hoping to find a solution
> without bothering the gmp community, but was unsuccessful.  I also
> searched through the last year of archives on this list.
>
> When I compile gmp 4.2.4 (32-bit) on OS X 10.5.4 I get:
>
> duplicate symbol ___gmpz_abs in /Users/wwilliam/Development/code/
> project/build/Debug/libcrypt.a(crypt.o) and /Users/wwilliam/
> Development/code/project/build/Debug/libcrypt.a(rsa.o)
>
> My understanding from my searches is that this due to a bug in Apple's
> inline implementation.
>
> Defining __GMP_FORCE_mpz_abs got rid of this error, but then the same
> error occurred with with __gmpz_fits_uint_p.  Defining
> __GMP_FORCE_mpz_fits_uint_p did not resolve that error, leading me to
> worry that I didn't truly understand the issue and changing things at
> random was not a good idea.
>
> I'm hoping this issue has been seen before and there's a simple
> solution that I'm just missing.
>
> Thanks,
>
> Wade
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://gmplib.org/list-archives/gmp-discuss/attachments/20090120/68ff3cb0/attachment.html
>
> Previous message: GMP can't handle leading plus sign?
> Next message: gmp 4.2.4 - mpf_add two large negative floats -  
> strange result
> Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> More information about the gmp-discuss mailing list
> _______________________________________________
> gmp-discuss mailing list
> gmp-discuss at gmplib.org
> https://gmplib.org/mailman/listinfo/gmp-discuss

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gmplib.org/list-archives/gmp-discuss/attachments/20090417/0654ac7d/attachment.html>


More information about the gmp-discuss mailing list