Inline errors on XCode 3.1.1 and libgmp 4.2.4
Inline errors on XCode 3.1.1 and libgmp 4.2.4
- Subject: Inline errors on XCode 3.1.1 and libgmp 4.2.4
- From: Wade Williams <email@hidden>
- Date: Thu, 15 Jan 2009 00:11:04 -0600
I'm trying to use gmp (in 32-bit mode) on OS X.
I've got it compiling fine. However, when I try to use it, 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)
__gmpz_abs is defined in gmp.h, included by both those files.
Significant portions of gmp.h are:
#if __GMP_HAVE_PROTOTYPES #define __GMP_PROTO(x) x #else #define __GMP_PROTO(x) () #endif
#if defined (__cplusplus) #define __GMP_NOTHROW throw () #else #define __GMP_NOTHROW #endif
#ifdef __GNUC__ #if (defined __GNUC_STDC_INLINE__) || (__GNUC__ == 4 && __GNUC_MINOR__ == 2) #define __GMP_EXTERN_INLINE extern __inline__ __attribute__ ((__gnu_inline__)) #else #define __GMP_EXTERN_INLINE extern __inline__ #endif #define __GMP_INLINE_PROTOTYPES 1 #endif
#ifdef __GMP_EXTERN_INLINE #ifndef __GMP_INLINE_PROTOTYPES #define __GMP_INLINE_PROTOTYPES 0 #endif #else #define __GMP_INLINE_PROTOTYPES 1
#define mpz_abs __gmpz_abs #if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_abs) __GMP_DECLSPEC void mpz_abs __GMP_PROTO ((mpz_ptr, mpz_srcptr)); #endif
#define mpz_fits_uint_p __gmpz_fits_uint_p #if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_fits_uint_p) __GMP_DECLSPEC int mpz_fits_uint_p __GMP_PROTO ((mpz_srcptr)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE; #endif
I've done lots of googling on this issue, and it and all signs point to it being a compiler bug related to inline implementation.
Anyone got any suggestions for working around this problem? I'm not sure the GMP author will make a change to work around an Apple compiler bug.
Thanks for any input,
Wade |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden