<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Joubert,<div><br></div><div>I just got around to testing this and it worked perfectly. Thanks so much for the suggestion!</div><div><br></div><div>As you suggested, I just changed the C Language Dialect to gnu89.</div><div><br></div><div>Wade</div><div><br><div><div>On Mar 17, 2009, at 7:38 PM, Joubert Nel wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi Wade,</div><div><br></div><div>I have also been struggling with the <b>duplicate symbol ___gmp_abs problem</b> for the last day. But finally found a solution.</div><div>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.</div><div><br></div><div>The following Build settings for my Target in XCode did the trick:</div><div>- C/C++ Compiler Version = <b>GCC 4.2</b></div><div>- C Language Dialect = <b>C99 [-std=c99]</b></div><div>- Other C flags: <b>-fgnu89-inline</b></div><div><br></div><div>Alternatively, if you simply compile with C Language Dialect set to 89 (instead of 99), that should work too.</div><div><br></div><div>Joubert</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><span class="Apple-style-span" style="font-size: 15px; "><h1>inline errors with gmp 4.2.4</h1><b>Wade Williams</b> <a href="mailto:gmp-discuss%40swox.com?Subject=inline%20errors%20with%20gmp%204.2.4&In-Reply-To=" title="inline errors with gmp 4.2.4">wadesworld at mac.com </a><br><i>Tue Jan 20 16:28:33 CET 2009</i><div><br class="webkit-block-placeholder"></div><ul><li>Previous message: <a href="http://gmplib.org/list-archives/gmp-discuss/2009-January/003520.html">GMP can't handle leading plus sign?</a></li><li>Next message: <a href="http://gmplib.org/list-archives/gmp-discuss/2009-January/003523.html">gmp 4.2.4 - mpf_add two large negative floats - strange result</a></li><li><b>Messages sorted by:</b> <a href="http://gmplib.org/list-archives/gmp-discuss/2009-January/date.html#3522">[ date ]</a> <a href="http://gmplib.org/list-archives/gmp-discuss/2009-January/thread.html#3522">[ thread ]</a> <a href="http://gmplib.org/list-archives/gmp-discuss/2009-January/subject.html#3522">[ subject ]</a> <a href="http://gmplib.org/list-archives/gmp-discuss/2009-January/author.html#3522">[ author ]</a></li></ul><hr><pre>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: <a href="http://gmplib.org/list-archives/gmp-discuss/attachments/20090120/68ff3cb0/attachment.html">http://gmplib.org/list-archives/gmp-discuss/attachments/20090120/68ff3cb0/attachment.html</a>
</pre><hr><div><br class="webkit-block-placeholder"></div><ul><li>Previous message: <a href="http://gmplib.org/list-archives/gmp-discuss/2009-January/003520.html">GMP can't handle leading plus sign?</a></li><li>Next message: <a href="http://gmplib.org/list-archives/gmp-discuss/2009-January/003523.html">gmp 4.2.4 - mpf_add two large negative floats - strange result</a></li><li><b>Messages sorted by:</b> <a href="http://gmplib.org/list-archives/gmp-discuss/2009-January/date.html#3522">[ date ]</a> <a href="http://gmplib.org/list-archives/gmp-discuss/2009-January/thread.html#3522">[ thread ]</a> <a href="http://gmplib.org/list-archives/gmp-discuss/2009-January/subject.html#3522">[ subject ]</a> <a href="http://gmplib.org/list-archives/gmp-discuss/2009-January/author.html#3522">[ author ]</a></li></ul><hr><a href="https://gmplib.org/mailman/listinfo/gmp-discuss">More information about the gmp-discuss mailing list</a></span></div></div>_______________________________________________<br>gmp-discuss mailing list<br><a href="mailto:gmp-discuss@gmplib.org">gmp-discuss@gmplib.org</a><br>https://gmplib.org/mailman/listinfo/gmp-discuss<br></blockquote></div><br></div></body></html>