On Wednesday, July 2, 2014 11:54:00 AM UTC-4, rajeshwaran shree wrote:
>
> friends,
>
> I want to generate crypto.dll , so download source from 
> http://www.cryptopp.com/  link
> I am using visual studio 2010 express
>
> When I build dll, It shows following error.
>
> 1>rijndael.obj : error LNK2001: unresolved external symbol "protected: 
> static unsigned char const * const CryptoPP::Rijndael::Base::Se" 
> (?Se@Base@Rijndael@CryptoPP@@1QBEB)
> 1>rijndael.obj : error LNK2001: unresolved external symbol "protected: 
> static unsigned char const * const CryptoPP::Rijndael::Base::Sd" 
> (?Sd@Base@Rijndael@CryptoPP@@1QBEB)
> 1>rijndael.obj : error LNK2001: unresolved external symbol "protected: 
> static unsigned int const * const CryptoPP::Rijndael::Base::rcon" 
> (?rcon@Base@Rijndael@CryptoPP@@1QBIB)
> 1>C:\Users\uma-2210\Documents\Visual Studio 
> 2010\Projects\cryTemp\Debug\cryTemp.dll : fatal error LNK1120: 3 unresolved 
> externals
>

They are declared in rijndael.h:

class CRYPTOPP_DLL Rijndael : public Rijndael_Info, public 
BlockCipherDocumentation
{
    class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Base : public 
BlockCipherImpl<Rijndael_Info>
    {
    public:
        void UncheckedSetKey(const byte *userKey, unsigned int length, 
const NameValuePairs &params);

    protected:
        static void FillEncTable();
        static void FillDecTable();

        // VS2005 workaround: have to put these on seperate lines, or error 
C2487 is triggered in DLL build
        static const byte Se[256];
        static const byte Sd[256];

        static const word32 rcon[];
        ...
    }
};

They are defined in rdtables.cpp:

const byte Rijndael::Base::Se[256] = {
    0x63, 0x7c, 0x77, 0x7b,
    0xf2, 0x6b, 0x6f, 0xc5,
    0x30, 0x01, 0x67, 0x2b,
    ...
}

My guess is you are not defining CRYPTOPP_IMPORTS and CRYPTOPP_EXPORTS 
properly. They set up CRYPTOPP_DLL and friends.

If you are consuming the DLL, then you should probably try importing 
<cryptopp/dll.h> in your project's <stdafx.h> *before* you import any other 
Crypto++ headers. <cryptopp/dll.h> sets the proper define for you. Or, you 
should define CRYPTOPP_IMPORTS in <stdafx.h> *before* you import any other 
Crypto++ headers.

If you are building your own DLL with Crypto++ sources, then you should 
look at the preprocessor definitions that Crypto++ uses in its solution. I 
think they include CRYPTOPP_EXPORTS and 
CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2=1.

One last note: I believe the DLL is FIPS 140 gear. You usually don't use it 
unless you need FIPS 140. If you don't need FIPS 140, then use static 
linking.

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.
--- 
You received this message because you are subscribed to the Google Groups 
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to