Nominate our 2022 Qt Champions!

Debug build LNK2005 cryptopp

  • Hi,
    I built Crypto++ 7 library using msvc2013, release dll. I linked it to my msvc2013 Qt app. If my app is built in release mode it runs. When I build it in debug configuration, linker outputs several LNK2005 errors:

    cryptopp.lib(cryptopp.dll):-1: error: LNK2005: "public: static char const * __cdecl CryptoPP::SHA256::StaticAlgorithmName(void)" (?StaticAlgorithmName@SHA256@CryptoPP@@SAPBDXZ) already defined in hwid.obj
    cryptopp.lib(cryptopp.dll):-1: error: LNK2005: "public: __thiscall CryptoPP::NotImplemented::NotImplemented(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0NotImplemented@CryptoPP@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) already defined in config.obj
    cryptopp.lib(cryptopp.dll):-1: error: LNK2005: "public: unsigned int __thiscall CryptoPP::BufferedTransformation::Put(unsigned char const *,unsigned int,bool)" (?Put@BufferedTransformation@CryptoPP@@QAEIPBEI_N@Z) already defined in config.obj

    I also trie to build debug cryptopp dll and link it with my app in debug configuration - with the same result.

    What is wrong with my app or cryptopp build?

  • Lifetime Qt Champion


    What version of SQLite are you using ?

  • Why sqlite? I use it, I think it is built in Qt (5.7.1 in my case). Or not?

  • Lifetime Qt Champion

    Completely unrelated... A usual case of answer on the wrong thread.

    The question was: how did you separate the debug and release builds of that library ?

  • Crypto++ comes with Visual Studio solution files, it is possible to build debug and release versions. But it seems DLL is not recomended for use, one should go with static build.

Log in to reply