Qt和Crypto ++链接器错误

时间:2014-12-13 17:27:19

标签: c++ qt linker crypto++

我在Qt 5.4和Crypto ++中遇到了一堆LNK2001和LNK2019错误。试过静态和动态链接。 Libs位于项目文件夹中,.pro文件具有以下内容:

win32: LIBS += -L$$PWD/ -lcryptlib

INCLUDEPATH += $$PWD/include

DEPENDPATH += $$PWD/include

win32:!win32-g++: PRE_TARGETDEPS += $$PWD/cryptlib.lib

else:win32-g++: PRE_TARGETDEPS += $$PWD/libcryptlib.a

一旦我从cryptopp头文件中引用某些内容,我就会收到15+个链接器错误。此外,lib是使用我用于Qt的相同MSVC2013编译器构建的。

有什么想法吗?

编辑:是的,抱歉不包括错误。

main.obj:-1: error: LNK2019: unresolved external symbol "public: __cdecl CryptoPP::Algorithm::Algorithm(bool)" (??0Algorithm@CryptoPP@@QEAA@_N@Z) referenced in function "public: __cdecl CryptoPP::BlockTransformation::BlockTransformation(void)" (??0BlockTransformation@CryptoPP@@QEAA@XZ)

main.obj:-1: error: LNK2001: unresolved external symbol "public: virtual void __cdecl CryptoPP::SimpleKeyingInterface::SetKey(unsigned char const *,unsigned __int64,class CryptoPP::NameValuePairs const &)" (?SetKey@SimpleKeyingInterface@CryptoPP@@UEAAXPEBE_KAEBVNameValuePairs@2@@Z)

main.obj:-1: error: LNK2001: unresolved external symbol "public: virtual void __cdecl CryptoPP::SimpleKeyingInterface::GetNextIV(class CryptoPP::RandomNumberGenerator &,unsigned char *)" (?GetNextIV@SimpleKeyingInterface@CryptoPP@@UEAAXAEAVRandomNumberGenerator@2@PEAE@Z)

main.obj:-1: error: LNK2019: unresolved external symbol "protected: unsigned __int64 __cdecl CryptoPP::SimpleKeyingInterface::ThrowIfInvalidIVLength(int)" (?ThrowIfInvalidIVLength@SimpleKeyingInterface@CryptoPP@@IEAA_KH@Z) referenced in function "public: virtual void __cdecl CryptoPP::BlockOrientedCipherModeBase::Resynchronize(unsigned char const *,int)" (?Resynchronize@BlockOrientedCipherModeBase@CryptoPP@@UEAAXPEBEH@Z)

main.obj:-1: error: LNK2001: unresolved external symbol "public: virtual unsigned int __cdecl CryptoPP::BlockTransformation::OptimalDataAlignment(void)const " (?OptimalDataAlignment@BlockTransformation@CryptoPP@@UEBAIXZ)

main.obj:-1: error: LNK2001: unresolved external symbol "public: virtual void __cdecl CryptoPP::StreamTransformation::ProcessLastBlock(unsigned char *,unsigned char const *,unsigned __int64)" (?ProcessLastBlock@StreamTransformation@CryptoPP@@UEAAXPEAEPEBE_K@Z)

main.obj:-1: error: LNK2019: unresolved external symbol "void * __cdecl CryptoPP::AlignedAllocate(unsigned __int64)" (?AlignedAllocate@CryptoPP@@YAPEAX_K@Z) referenced in function "public: unsigned char * __cdecl CryptoPP::AllocatorWithCleanup<unsigned char,1>::allocate(unsigned __int64,void const *)" (?allocate@?$AllocatorWithCleanup@E$00@CryptoPP@@QEAAPEAE_KPEBX@Z)

main.obj:-1: error: LNK2019: unresolved external symbol "void __cdecl CryptoPP::AlignedDeallocate(void *)" (?AlignedDeallocate@CryptoPP@@YAXPEAX@Z) referenced in function "public: void __cdecl CryptoPP::AllocatorWithCleanup<unsigned char,1>::deallocate(void *,unsigned __int64)" (?deallocate@?$AllocatorWithCleanup@E$00@CryptoPP@@QEAAXPEAX_K@Z)

main.obj:-1: error: LNK2019: unresolved external symbol "void * __cdecl CryptoPP::UnalignedAllocate(unsigned __int64)" (?UnalignedAllocate@CryptoPP@@YAPEAX_K@Z) referenced in function "public: unsigned char * __cdecl CryptoPP::AllocatorWithCleanup<unsigned char,1>::allocate(unsigned __int64,void const *)" (?allocate@?$AllocatorWithCleanup@E$00@CryptoPP@@QEAAPEAE_KPEBX@Z)

main.obj:-1: error: LNK2019: unresolved external symbol "void __cdecl CryptoPP::UnalignedDeallocate(void *)" (?UnalignedDeallocate@CryptoPP@@YAXPEAX@Z) referenced in function "public: void __cdecl CryptoPP::AllocatorWithCleanup<unsigned char,1>::deallocate(void *,unsigned __int64)" (?deallocate@?$AllocatorWithCleanup@E$00@CryptoPP@@QEAAXPEAX_K@Z)

main.obj:-1: error: LNK2001: unresolved external symbol "public: virtual void __cdecl CryptoPP::BlockOrientedCipherModeBase::UncheckedSetKey(unsigned char const *,unsigned int,class CryptoPP::NameValuePairs const &)" (?UncheckedSetKey@BlockOrientedCipherModeBase@CryptoPP@@UEAAXPEBEIAEBVNameValuePairs@2@@Z)

main.obj:-1: error: LNK2001: unresolved external symbol "public: virtual void __cdecl CryptoPP::CBC_Encryption::ProcessData(unsigned char *,unsigned char const *,unsigned __int64)" (?ProcessData@CBC_Encryption@CryptoPP@@UEAAXPEAEPEBE_K@Z)

main.obj:-1: error: LNK2001: unresolved external symbol "public: virtual void __cdecl CryptoPP::Rijndael::Base::UncheckedSetKey(unsigned char const *,unsigned int,class CryptoPP::NameValuePairs const &)" (?UncheckedSetKey@Base@Rijndael@CryptoPP@@UEAAXPEBEIAEBVNameValuePairs@3@@Z)

main.obj:-1: error: LNK2001: unresolved external symbol "public: virtual void __cdecl CryptoPP::Rijndael::Enc::ProcessAndXorBlock(unsigned char const *,unsigned char const *,unsigned char *)const " (?ProcessAndXorBlock@Enc@Rijndael@CryptoPP@@UEBAXPEBE0PEAE@Z)

main.obj:-1: error: LNK2001: unresolved external symbol "public: virtual unsigned __int64 __cdecl CryptoPP::Rijndael::Enc::AdvancedProcessBlocks(unsigned char const *,unsigned char const *,unsigned char *,unsigned __int64,unsigned int)const " (?AdvancedProcessBlocks@Enc@Rijndael@CryptoPP@@UEBA_KPEBE0PEAE_KI@Z)

我正在使用下载的Qt,在Qt Creator的大概部分中,它说它是用MSVC 2010 32bit编译的。

0 个答案:

没有答案