Hello!
I need to build cryptopp 5.6.1 for OS/X using Xcode 4.0+
When I set the compiler to GCC 4.2 I am able to build the static lib.
However, when trying to build the provided cryptest application
against it, I get linking errors. (I am using Snow Leopard 10.6.7 and
I used xcode 3.2.5 project as a reference form the bottom of this
<http://www.cryptopp.com/wiki/IOS> page.)
Ld /Users/svp/Library/Developer/Xcode/DerivedData/cryptopp-test-
fhbrajkkbingzucdhvpvqnfsjfbf/Build/Products/Debug/cryptest normal
x86_64
cd /Volumes/data/Repos/hookflash-libs/cryptopp/projects/xcode/
cryptopp
setenv MACOSX_DEPLOYMENT_TARGET 10.6
/Developer/usr/bin/g++-4.2 -arch x86_64 -isysroot /Developer/SDKs/
MacOSX10.6.sdk -L/Users/svp/Library/Developer/Xcode/DerivedData/
cryptopp-test-fhbrajkkbingzucdhvpvqnfsjfbf/Build/Products/Debug -F/
Users/svp/Library/Developer/Xcode/DerivedData/cryptopp-test-
fhbrajkkbingzucdhvpvqnfsjfbf/Build/Products/Debug -filelist /Users/svp/
Library/Developer/Xcode/DerivedData/cryptopp-test-
fhbrajkkbingzucdhvpvqnfsjfbf/Build/Intermediates/cryptopp-test.build/
Debug/cryptest.build/Objects-normal/x86_64/cryptest.LinkFileList -
mmacosx-version-min=10.6 -lcryptopp -o /Users/svp/Library/Developer/
Xcode/DerivedData/cryptopp-test-fhbrajkkbingzucdhvpvqnfsjfbf/Build/
Products/Debug/cryptest
Undefined symbols for architecture x86_64:
"CryptoPP::AlignedAllocate(unsigned long)", referenced from:
CryptoPP::AllocatorWithCleanup<unsigned char,
true>::allocate(unsigned long, void const*)in bench.o
CryptoPP::AllocatorWithCleanup<unsigned char,
true>::allocate(unsigned long, void const*)in bench2.o
CryptoPP::AllocatorWithCleanup<unsigned char,
true>::allocate(unsigned long, void const*)in dlltest.o
CryptoPP::AllocatorWithCleanup<unsigned char,
true>::allocate(unsigned long, void const*)in fipstest.o
CryptoPP::AllocatorWithCleanup<unsigned char,
true>::allocate(unsigned long, void const*)in regtest.o
CryptoPP::AllocatorWithCleanup<unsigned char,
true>::allocate(unsigned long, void const*)in test.o
CryptoPP::AllocatorWithCleanup<unsigned char,
true>::allocate(unsigned long, void const*)in validat1.o
...
"CryptoPP::AlignedDeallocate(void*)", referenced from:
CryptoPP::AllocatorWithCleanup<unsigned char,
true>::deallocate(void*, unsigned long)in bench.o
CryptoPP::AllocatorWithCleanup<unsigned char,
true>::deallocate(void*, unsigned long)in bench2.o
CryptoPP::AllocatorWithCleanup<unsigned char,
true>::deallocate(void*, unsigned long)in dlltest.o
CryptoPP::AllocatorWithCleanup<unsigned char,
true>::deallocate(void*, unsigned long)in fipstest.o
CryptoPP::AllocatorWithCleanup<unsigned char,
true>::deallocate(void*, unsigned long)in regtest.o
CryptoPP::AllocatorWithCleanup<unsigned char,
true>::deallocate(void*, unsigned long)in test.o
CryptoPP::AllocatorWithCleanup<unsigned char,
true>::deallocate(void*, unsigned long)in validat1.o
...
"vtable for CryptoPP::SHA224", referenced from:
CryptoPP::SHA224::~SHA224()in fipstest.o
CryptoPP::SHA224::SHA224(CryptoPP::SHA224 const&)in fipstest.o
CryptoPP::SHA224::SHA224()in fipstest.o
CryptoPP::SHA224::~SHA224()in regtest.o
CryptoPP::SHA224::SHA224(CryptoPP::SHA224 const&)in regtest.o
CryptoPP::SHA224::SHA224()in regtest.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
On Aug 22, 1:37 am, Jeffrey Walton <[email protected]> wrote:
> On Aug 21, 6:58 pm, Rob <[email protected]> wrote:
>
>
>
>
>
>
>
> > I'm on a mac compiling with xcode 4 on Snow Leapord for OS/X build
> > 64bit using cryptopp 5.6.1
>
> > Assertion failed: (memcmp(P, A, 4*WORD_SIZE)==0), function
> > AtomicDivide, file cryptopp/integer.cpp, line 2530.
>
> > Related cryptopp code:
> > assert(!T[2] && !T[3] && (T[1] < B[1] || (T[1]==B[1] &&
> > T[0]<B[0])));
> > word P[4];
> > s_pMul[0](P, Q, B);
> > Add(P, P, T, 4);
> > assert(memcmp(P, A, 4*WORD_SIZE)==0);
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ fails here
>
> > Seems that P has a value of
> > [0] 0x0
> > [1] 0x4000000000000001
> > [2] 0x4000000000000000
> > [0] 0x0
>
> > Whereas A has a value of
> > [0] 0x0
> > [1] 0x4000000000000000
> > [2] 0x4000000000000000
> > [0] 0x0
>
> > Thus the assertion fails since it's off by 1 in the [1] word array
> > position.
>
> > FYI WORD_SIZE is set to "8" in that code.
>
> > My test code:
>
> > AutoSeededRandomPool rnd;
>
> > RSA::PrivateKey rsaPrivate;
> > rsaPrivate.GenerateRandomWithKeySize(rnd, 2048);
>
> > Also I had a compile error that I had to fix:
>
> > pointer allocate(size_type n, const void * = NULL)
> > {
> > - CheckSize(n);
> > + AllocatorBase<T>::CheckSize(n);
>
> > ^ I had to put the "AllocatorBase<T>::" in front of "CheckSize" or it
> > wouldn't see "CheckSize" routine.
>
> > Any ideas?
>
> What compiler are you using?
>
> For what its worth, I have not had problems on the command line or in
> Xcode 3.2.x running Snow Leopard or Lion from a MacBook when using
> GCC.
>
> Jeff
--
You received this message because you are subscribed to the "Crypto++ Users"
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at
http://www.cryptopp.com.