This doesn't appear to work if I'm linking to the MFC library
statically also, as I get conflicts with the new and delete symbols
already defined (in this case, within the MFC library). There doesn't
seem to be a way to make this work without dynamically linking
everything (unless I'm missing something).

- Nick

On Aug 22, 7:05 pm, "Wei Dai" <[EMAIL PROTECTED]> wrote:
> If you're using a static C++ runtime library, then you have to use "method
> 2" as the Readme.txt says:
>
> 2.  Crypto++ can tell the calling application what heap to use. This method
>     is required when the calling application uses a statically linked C++
> Run
>     Time Library. (Method 1 does not work in this case because the Crypto++
> DLL
>     is initialized before the calling application's heap is initialized.)
>
> This means you need to use "SetNewAndDeleteFromCryptoPP", which has an
> example in dlltest.cpp.
>
> ----- Original Message -----
> From: "Nick42" <[EMAIL PROTECTED]>
> To: "Crypto++ Users" <[EMAIL PROTECTED]>
> Sent: Wednesday, August 22, 2007 4:30 PM
> Subject: Re: Question about FIPS dll usage and util functions
>
> > Thanks for the response... I saw this after I posted, and got it
> > working (well, linking at least), but I have a followup question:
>
> > I have not been able to get the memory management working. I am
> > statically linking the C runtime, and have tried defining
> > GetNewAndDeleteForCryptoPP, but I'm not sure how it needs to be
> > defined such that cryptopp can pick it up, and I can't find any
> > example of how to define it in the cryptest project. I would prefer to
> > tell cryptopp the new/delete functions to use, in case in the future I
> > have other libraries linking this way, to prevent conflicts.
>
> > Is there example code on how to implement this function somewhere, or
> > any magic, or something which will not work with how I'm trying to use
> > it?
>
> > Also, as a side note, I get the following error compiling the cryptdll
> > project from the 5.3 FIPS code with VS2005:
> > 2>.\integer.cpp(88) : error C2244:
> > 'CryptoPP::AlignedAllocator<T>::allocate' : unable to match function
> > definition to an existing declaration
> > 2>        [...]\cryptopp_5_3_fips\include\integer.h(44) : see
> > declaration of 'CryptoPP::AlignedAllocator<T>::allocate'
> > 2>        definition
> > 2>        'AllocatorBase<T>::pointer
> > CryptoPP::AlignedAllocator<T>::allocate(CryptoPP::AlignedAllocator<T>::size_type,const
> > void *)'
> > 2>        existing declarations
> > 2>        'T
> > *CryptoPP::AlignedAllocator<T>::allocate(CryptoPP::AlignedAllocator<T>::size_type,const
> > void *)'
>
> > Not a big deal since I want to use the FIPS certified pre-compiled DLL
> > anyway, but thought I'd post it in case it's not a known issue.
>
> > - Nick
>
> > On Aug 20, 5:07 pm, "Wei Dai" <[EMAIL PROTECTED]> wrote:
> >> You can build a static library that contains only code that are not in
> >> the
> >> DLL, by building the "DLL-Import Debug" or "DLL-Import Release"
> >> configuration instead of the "Debug" or "Release" configuration. Then you
> >> can link your application with both the DLL and the static library.
>
> >> ----- Original Message -----
> >> From: "Nick42" <[EMAIL PROTECTED]>
> >> To: "Crypto++ Users" <[EMAIL PROTECTED]>
> >> Sent: Monday, August 20, 2007 4:28 PM
> >> Subject: Question about FIPS dll usage and util functions
>
> >> > I've been using crypto++ as a static lib for a while, and am trying to
> >> > convert to use as a FIPS certified dll. However, only some of the
> >> > objects are included in the FIPS dll, and we are using some of the
> >> > others also, which is causing linking to fail.
>
> >> > Is there a suggested way to link both the FIPS certified dll and the
> >> > extra utility code? I didn't see a lib with only the utility code. Has
> >> > anyone else attempted this, and/or is there something easy I'm missing?


--~--~---------~--~----~------------~-------~--~----~
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.
-~----------~----~----~----~------~----~------~--~---

Reply via email to