Discussion:
[cryptopp-users] Debug build LNK2005 errors
Martin Dušek
2018-08-03 21:05:45 UTC
Permalink
Hi,
I built Crypto++ 7 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: __thiscall
CryptoPP::NotImplemented::NotImplemented(class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > const &)"
(??***@CryptoPP@@***@ABV?$***@DU?$***@D@std@@V?$***@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)" (?***@BufferedTransformation@CryptoPP@@***@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?
--
You received this message because you are subscribed to "Crypto++ Users". More information about Crypto++ and this group is available at http://www.cryptopp.com and http://groups.google.com/forum/#!forum/cryptopp-users.
---
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 cryptopp-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Martin Dušek
2018-08-03 21:12:01 UTC
Permalink
Hi,
I built Crypto++ 7 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)"
(?***@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 &)"
(??***@CryptoPP@@***@ABV?$***@DU?$***@D@std@@V?$***@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)" (?***@BufferedTransformation@CryptoPP@@***@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?
--
You received this message because you are subscribed to "Crypto++ Users". More information about Crypto++ and this group is available at http://www.cryptopp.com and http://groups.google.com/forum/#!forum/cryptopp-users.
---
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 cryptopp-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jeffrey Walton
2018-08-03 21:56:51 UTC
Permalink
Post by Martin Dušek
Hi,
I built Crypto++ 7 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
cryptopp.lib(cryptopp.dll):-1: error: LNK2005: "public: static char const *
__cdecl CryptoPP::SHA256::StaticAlgorithmName(void)"
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 &)"
already defined in config.obj
cryptopp.lib(cryptopp.dll):-1: error: LNK2005: "public: unsigned int
__thiscall CryptoPP::BufferedTransformation::Put(unsigned char const
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?
The DLL is a special purpose FIPS DLL. It is missing most general
classes. It only has classes for FIPS algorithms. You still have to
link to cryptlib.lib to get the missing classes. Also see
https://www.cryptopp.com/wiki/FIPS_DLL.

You should link to the static library. _IF_ you really want a DLL then
create a wrapper DLL than links to the static library.

I want to delete the projects because (1) the DLL is on the Historical
Validation List so it is no longer valid; and (2) it is a constant
source of problems for users.

Jeff
--
You received this message because you are subscribed to "Crypto++ Users". More information about Crypto++ and this group is available at http://www.cryptopp.com and http://groups.google.com/forum/#!forum/cryptopp-users.
---
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 cryptopp-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jeffrey Walton
2018-08-27 13:37:54 UTC
Permalink
Post by Jeffrey Walton
Post by Martin Dušek
...
What is wrong with my app or cryptopp build?
The DLL is a special purpose FIPS DLL. It is missing most general
classes. It only has classes for FIPS algorithms. You still have to
link to cryptlib.lib to get the missing classes. Also see
https://www.cryptopp.com/wiki/FIPS_DLL.
You should link to the static library. _IF_ you really want a DLL then
create a wrapper DLL than links to the static library.
We added a wiki page on creating wrapper DLLs. Also see
https://www.cryptopp.com/wiki/Wrapper_DLL .

Jeff
--
You received this message because you are subscribed to "Crypto++ Users". More information about Crypto++ and this group is available at http://www.cryptopp.com and http://groups.google.com/forum/#!forum/cryptopp-users.
---
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 cryptopp-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...