链接器错误时构建DLL依赖于静态lib Crypto ++ [英] Linker errors when building DLL dependent on static lib Crypto++

查看:1064
本文介绍了链接器错误时构建DLL依赖于静态lib Crypto ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里是一个序言 - 我有一个C ++ + Qt应用程序,它包括几个项目,我们正在使用MSVC 2012来构建它。现在,我实现构建脚本以开始部署构建服务器。因此,我开始为每个项目创建Qt .pro文件。



现在问题 - 我们使用Crypto ++库href =http://www.cryptopp.com/ =nofollow> http://www.cryptopp.com/ ),我们从源代码构建,输出是静态lib,而我们有DLL依赖于cryptlib.lib。



我为Cryptlib写了.pro文件,我可以使用qmake / jom来创建

  QT  -  = core gui 
QMAKE_CFLAGS + = / Zc:wchar_t

TEMPLATE = lib
TARGET = cryptlib

发布:DESTDIR = ./Release
调试:DESTDIR = ./Debug

CONFIG + = staticlib precompile_header
DEFINES + = _USING_V110_SDK71_ WINVER = 0x0501 WIN32 _WINDOWS _MBCS
DEFINES - = UNICODE

PRECOMPILED_HEADER = pch.h
DEPENDPATH + =。

include(CryptoPP.pri)@

我的DLL - 它编译好,但我得到链接器错误链接阶段。最有趣的事情是,当我用MSVC2012构建cryptlib和然后使用qmake构建DLL,然后它链接确定。



?我检查了MSVC项目中的所有proj设置,并应用于我的pro文件。我检查名称mangling在用MSVC和QT构建的两个库 - mangled名称看起来一样。现在我陷入了

  @#-------------------- -------------------------------- 
#此文件由Qt Visual Studio加载项生成。
#--------------------------------------------- ---------

QT - = gui core
QMAKE_CFLAGS + = / Zc:wchar_t

TEMPLATE = lib
TARGET = PSGLicensing

发布:DESTDIR = ./Release
调试:DESTDIR = ./Debug

CONFIG + = dll
DEFINES + = _AFXDLL _USING_V110_SDK71_ WIN32 _WINDOWS _WINDLL _USRDLL DLL_LIBRARY PSGLICENSING_DLL_BUILD _MBCS _VC80_UPGRADE = 0x0710
DEFINES - = UNICODE

PRECOMPILED_HEADER = stdafx.h
DEPENDPATH + =。

win32:CONFIG(release,debug | release):LIBS + = -L $$ _ PRO_FILE_PWD _ / .. / CryptoPP / Release / -lcryptlib
else:win32:CONFIG | release):LIBS + = -L $$ _ PRO_FILE_PWD _ / .. / CryptoPP / Debug / -lcryptlib

INCLUDEPATH + = $$ _ PRO_FILE_PWD _ / .. / CryptoPP /
DEPENDPATH + = $ $ _PRO_FILE_PWD _ / .. / CryptoPP /

win32:CONFIG(release,debug | release):PRE_TARGETDEPS + = $$ _ PRO_FILE_PWD _ / .. / CryptoPP / Release / cryptlib.lib
else: win32:CONFIG(debug,debug | release):PRE_TARGETDEPS + = $$ _ PRO_FILE_PWD _ / .. / CryptoPP / Debug / cryptlib.lib

include(PSGLicensing.pri)@


CryptLib

strong>

  *编译器:* /Yu\"pch.h/ GS / GL / analyze- / W3 / Zc:wchar_t / Zi / Gm- / O2 / Ob2 /Fd\"Release\vc110.pdb/ fp:precise / Zp1 / D_USING_V110_SDK71_/ DNDEBUG/ D_WINDOWS/ DUSE_PRECOMPILED_HEADERS/ D WIN32/ DWINVER = 0x0501/ D_VC80_UPGRADE = 0x0710/ errorReport:prompt / GF- / WX- / Zc:forScope / arch:SSE / Gd / Oy / Oi / MD / / EHsc / nologo / FoRelease\/Fp\"Release\cryptlib.pch

*链接器:* /OUT:\"SecretPath\CryptoPP\Release\cryptlib.lib / LTCG / NOLOGO

这里是 DLL

  *编译器*:/Yu\"stdafx.h/ GS / analyze- / W3 / Zc:wchar_t / ISecretPath \PSGLicensing \\ \\IncludeExp/ Zi / Gm- / O2 /Fd\"Release\vc110.pdb/ fp:precise / D_USING_V110_SDK71_/ DWIN32/ D_WINDOWS/ DNDEBUG/ D_USRDLL DPSGLICENSING_DLL_BUILD/ D_VC80_UPGRADE = 0x0710/ D_WINDLL/ D_MBCS/ D_AFXDLL/ errorReport:prompt / WX- / Zc:forScope / Gd / Oy- / MD / / EHsc / nologo / FoRelease\/Fp\"Release\PSGLicensing.pch

*链接器:* /OUT:\"SecretPah\PSGLicensing\Release\PSGLicensing.dll / MANIFEST /PDB:\"SecretPath\PSGLicensing\Release\PSGLicensing.pdb/ DYNAMICBASE:NO..\CryptoPP\Release\cryptlib.libSecretPath\CryptoPP\Release\cryptlib .lib/DEF:\".\PSGLicensing.def/IMPLIB:\"SecretPath\PSGLicensing\Release\PSGLicensing.lib/ DEBUG / DLL / MACHINE:X86 / OPT:REF / SAFESEH / INCREMENTAL:NO / PGD​​:SecretPath\PSGLicensing\Release\PSGLicensing.pgd/SUBSYSTEM:WINDOWS\",5.01/ MANIFESTUAC:level ='asInvoker'uiAccess ='false'/ManifestFile:\"Release\PSGLicensing.dll。 intermediate.manifest/ OPT:ICF / ERRORREPORT:PROMPT / NOLOGO / TLBID:1

输出

  @ C:\Qt\Qt5.2.1\Tools\QtCreator\bin\jom.exe -f Makefile.Release 
link / NOLOGO / DYNAMICBASE / NXCOMPAT / INCREMENTAL:NO / DLL / MANIFEST /MANIFESTFILE:Release\PSGLicensing.dll.embed.manifest /OUT:Release\PSGLicensing.dll @C: \\Users\ANDRIY〜1.GLO\AppData\Local\Temp\PSGLicensing.dll.6212.16.jom
创建库Release\PSGLicensing.lib和对象Release\PSGLicensing.exp
GenerateRandomBlock.obj:错误LNK2001:无法解析的外部符号市民:虚拟无效__thiscall CryptoPP :: CFB_CipherTemplate<类CryptoPP :: AbstractPolicyHolder<类CryptoPP :: CFB_CipherAbstractPolicy,类CryptoPP :: CFB_ModePolicy> > :: ProcessData(unsigned char *,unsigned char const *,unsigned int)(?ProcessData @?$ CFB_CipherTemplate @V?$ AbstractPolicyHolder @ VCFB_CipherAbstractPolicy @ CryptoPP @@ VCFB_ModePolicy @ 2 @@ CryptoPP @@@ CryptoPP @@ UAEXPAEPBEI @Z)
GenerateRandomBlock.obj:错误LNK2001:无法解析的外部符号市民:虚拟无效__thiscall CryptoPP :: CFB_CipherTemplate<类CryptoPP :: AbstractPolicyHolder<类CryptoPP :: CFB_CipherAbstractPolicy,类CryptoPP :: CFB_ModePolicy> > :: Resynchronize(unsigned char const *,int)(?Resynchronize @?$ CFB_CipherTemplate @ V?$ AbstractPolicyHolder @ VCFB_CipherAbstractPolicy @ CryptoPP @@ VCFB_ModePolicy @ 2 @@ CryptoPP @@@ CryptoPP @@ UAEXPBEH @ Z)
GenerateRandomBlock.obj:错误LNK2001:无法解析的外部符号受保护:虚拟无效__thiscall CryptoPP :: CFB_CipherTemplate<类CryptoPP :: AbstractPolicyHolder<类CryptoPP :: CFB_CipherAbstractPolicy,类CryptoPP :: CFB_ModePolicy> > :: UncheckedSetKey(unsigned char const *,unsigned int,class CryptoPP :: NameValuePairs const&)(?UncheckedSetKey @?$ CFB_CipherTemplate @V?$ AbstractPolicyHolder @ VCFB_CipherAbstractPolicy @ CryptoPP @@ VCFB_ModePolicy @ 2 @ CryptoPP @@ @ CryptoPP @@ MAEXPBEIABVNameValuePairs @ 2 @@ Z)
GenerateRandomBlock.obj:错误LNK2001:无法解析的外部符号私人:虚拟无效__thiscall CryptoPP :: CFB_EncryptionTemplate<类CryptoPP :: AbstractPolicyHolder<类CryptoPP :: CFB_CipherAbstractPolicy,类CryptoPP :: CFB_ModePolicy> >有?:: CombineMessageAndShiftRegister(无符号字符*,无符号字符*,无符号的字符常量*,无符号整型)(CombineMessageAndShiftRegister @ $ @ CFB_EncryptionTemplate V $ @ AbstractPolicyHolder @ VCFB_CipherAbstractPolicy @@ CryptoPP @ VCFB_ModePolicy 2 @@ CryptoPP @@@ CryptoPP @@ EAEXPAE0PBEI @ Z)
cryptlib.lib(rsa.obj):error LNK2001:unresolved external symbolpublic:virtual void __thiscall CryptoPP :: IteratedHashBase< unsigned int,CryptoPP :: HashTransformation> :: Update unsigned char const *,unsigned int)(?Update @?$ IteratedHashBase @ IVHashTransformation @ CryptoPP @@@ CryptoPP @@ UAEXPBEI @ Z)
LicensingEx.obj:error LNK2001:未解析的外部符号public:virtual void __thiscall CryptoPP :: IteratedHashBase< unsigned int,class CryptoPP :: HashTransformation> :: Update(unsigned char const *,unsigned int)(?Update @?$ IteratedHashBase @ IVHashTransformation @ CryptoPP @@@ CryptoPP @@ UAEXPBEI @ Z)
cryptlib.lib(randpool.obj):错误LNK2001:无法解析的外部符号市民:虚拟无效__thiscall CryptoPP :: IteratedHashBase< unsigned int类型,类CryptoPP :: HashTransformation> ::更新(无符号字符常量*,无符号整型) (?Update @?$ IteratedHashBase @ IVHashTransformation @ CryptoPP @@@ CryptoPP @@ UAEXPBEI @ Z)
cryptlib.lib(md5.obj):error LNK2001:未解析的外部符号public:virtual void __thiscall CryptoPP :: IteratedHashBase ; unsigned int,class CryptoPP :: HashTransformation> :: Update(unsigned char const *,unsigned int)(?Update @?$ IteratedHashBase @ IVHashTransformation @ CryptoPP @@@ CryptoPP @@ UAEXPBEI @ Z)
cryptlib。 lib(integer.obj):error LNK2001:unresolved external symbolpublic:virtual void __thiscall CryptoPP :: IteratedHashBase< unsigned int,class CryptoPP :: HashTransformation> :: Update(unsigned char const *,unsigned int) ?$ IteratedHashBase @ IVHashTransformation @ CryptoPP @@@ CryptoPP @@ UAEXPBEI @ Z)
cryptlib.lib(rsa.obj):error LNK2001:未解析的外部符号public:virtual unsigned char * __thiscall CryptoPP :: IteratedHashBase& int CryptoPP :: HashTransformation> :: CreateUpdateSpace(unsigned int&)(?CreateUpdateSpace @?$ IteratedHashBase @ IVHashTransformation @ CryptoPP @@@ CryptoPP @@ UAEPAEAAI @ Z)
LicensingEx.obj:error LNK2001:解析外部符号?市民:虚拟无符号字符* __thiscall CryptoPP :: IteratedHashBase< unsigned int类型,类CryptoPP :: HashTransformation> :: CreateUpdateSpace(unsigned int类型和放大器;)(CreateUpdateSpace @ $ IteratedHashBase @ IVHashTransformation @ CryptoPP @@@ CryptoPP @@ UAEPAEAAI @ Z)
cryptlib.lib(randpool.obj):错误LNK2001:无法解析的外部符号市民:虚拟无符号字符* __thiscall CryptoPP :: IteratedHashBase< unsigned int类型,类CryptoPP :: HashTransformation> :: CreateUpdateSpace (unsigned int&)(?CreateUpdateSpace @?$ IteratedHashBase @ IVHashTransformation @ CryptoPP @@@ CryptoPP @@ UAEPAEAAI @ Z)
cryptlib.lib(md5.obj):error LNK2001:未解析的外部符号public: virtual unsigned char * __thiscall CryptoPP :: IteratedHashBase< unsigned int,class CryptoPP :: HashTransformation> :: CreateUpdateSpace(unsigned int&)(?CreateUpdateSpace @?$ IteratedHashBase @IVHashTransformation @ CryptoPP @@@ CryptoPP @@ UAEPAEAAI @ Z)
cryptlib.lib(integer.obj):error LNK2001:unresolved external symbolpublic:virtual unsigned char * __thiscall CryptoPP :: IteratedHashBase< unsigned int,class CryptoPP :: HashTransformation> :: CreateUpdateSpace(unsigned int& (?CreateUpdateSpace @?$ IteratedHashBase @ IVHashTransformation @ CryptoPP @@@ CryptoPP @@ UAEPAEAAI @ Z)
cryptlib.lib(rsa.obj):error LNK2001:未解析的外部符号public:virtual void __thiscall CryptoPP :: IteratedHashBase< unsigned int,class CryptoPP :: HashTransformation> :: Restart(void)(?重新启动@?$ IteratedHashBase @ IVHashTransformation @ CryptoPP @@@ CryptoPP @@ UAEXXZ)
LicensingEx.obj:error LNK2001:unresolved external symbolpublic:virtual void __thiscall CryptoPP :: IteratedHashBase< unsigned int,class CryptoPP :: HashTransformation> :: Restart(void)(?Restart @?$ IteratedHashBase @ IVHashTransformation @ CryptoPP @@@ CryptoPP @@ UAEXXZ)
cryptlib.lib(randpool.obj):error LNK2001:未解析的外部符号public:virtual void __thiscall CryptoPP :: IteratedHashBase< unsigned int,class CryptoPP :: HashTransformation> :: Restart(void)(?Restart @?$ IteratedHashBase @ IVHashTransformation @ CryptoPP @@@ CryptoPP @@ UAEXXZ)
cryptlib.lib(md5.obj):error LNK2001:未解析的外部符号public:virtual void __thiscall CryptoPP :: IteratedHashBase< unsigned int,class CryptoPP :: HashTransformation> ; :: Restart(void)(?Restart @?$ IteratedHashBase @ IVHashTransformation @ CryptoPP @@@ CryptoPP @@ UAEXXZ)
cryptlib.lib(integer.obj):error LNK2001:未解析的外部符号public:virtual void __thiscall CryptoPP :: IteratedHashBase< unsigned int,class CryptoPP :: HashTransformation> :: Restart(void)(?Restart @?$ IteratedHashBase @ IVHashTransformation @ CryptoPP @@@ CryptoPP @@ UAEXXZ)
cryptlib.lib rsa.obj):error LNK2001:未解析的外部符号public:virtual void __thiscall CryptoPP :: IteratedHashBase< unsigned int,class CryptoPP :: HashTransformation> :: TruncatedFinal(unsigned char *,unsigned int)(?TruncatedFinal @?$ IteratedHashBase @ IVHashTransformation @ CryptoPP @@@ CryptoPP @@ UAEXPAEI @ Z)
LicensingEx.obj:error LNK2001:未解析的外部符号public:virtual void __thiscall CryptoPP :: IteratedHashBase< unsigned int,class CryptoPP :: HashTransformation> TruncatedFinal(unsigned char *,unsigned int)(?TruncatedFinal @?$ IteratedHashBase @ IVHashTransformation @ CryptoPP @@@ CryptoPP @@ UAEXPAEI @ Z)
cryptlib.lib(randpool.obj):error LNK2001:unresolved external symbol public void __thiscall CryptoPP :: IteratedHashBase< unsigned int,class CryptoPP :: HashTransformation> :: TruncatedFinal(unsigned char *,unsigned int)(?TruncatedFinal @?$ IteratedHashBase @IVHashTransformation @ CryptoPP @@@ CryptoPP @@ UAEXPAEI @Z)
cryptlib.lib(md5.obj):error LNK2001:unresolved external symbolpublic:virtual void __thiscall CryptoPP :: IteratedHashBase< unsigned int,CryptoPP :: HashTransformation> :: TruncatedFinal(unsigned char * unsigned int)(?TruncatedFinal @?$ IteratedHashBase @ IVHashTransformation @ CryptoPP @@@ CryptoPP @@ UAEXPAEI @ Z)
cryptlib.lib(integer.obj):error LNK2001:未解析的外部符号public:virtual void __thiscall CryptoPP :: IteratedHashBase< unsigned int,class CryptoPP :: HashTransformation> :: TruncatedFinal(unsigned char *,unsigned int)(?TruncatedFinal @?$ IteratedHashBase @ IVHashTransformation @ CryptoPP @@@ CryptoPP @@ UAEXPAEI @ Z)
LicensingEx.obj:error LNK2001:未解析的外部符号protected:virtual unsigned int __thiscall CryptoPP :: IteratedHashBase< unsigned int,class CryptoPP :: HashTransformation> :: HashMultipleBlocks(unsigned int const *,unsigned int)(?HashMultipleBlocks? $ IteratedHashBase @ IVHashTransformation @ CryptoPP @@@ CryptoPP @@ MAEIPBII @ Z)
cryptlib.lib(md5.obj):error LNK2001:未解析的外部符号protected:virtual unsigned int __thiscall CryptoPP :: IteratedHashBase& class CryptoPP :: HashTransformation> :: HashMultipleBlocks(unsigned int const *,unsigned int)(?HashMultipleBlocks @?$ IteratedHashBase @ IVHashTransformation @ CryptoPP @@@ CryptoPP @@ MAEIPBII @ Z)
cryptlib.lib obj):error LNK2001:未解析的外部符号protected:virtual unsigned int __thiscall CryptoPP :: IteratedHashBase< unsigned int,class CryptoPP :: HashTransformation> :: HashMultipleBlocks(unsigned int const *,unsigned int)(?HashMultipleBlocks @?IteratedHashBase @ IVHashTransformation @ CryptoPP @@@ CryptoPP @@ MAEIPBII @ Z)
cryptlib.lib(rsa.obj):error LNK2001:未解析的外部符号protected:virtual unsigned int __thiscall CryptoPP :: IteratedHashBase< unsigned int,CryptoPP :: HashTransformation> :: HashMultipleBlocks(unsigned int const *,unsigned int)(?HashMultipleBlocks @?$ IteratedHashBase @ IVHashTransformation @ CryptoPP @@@ CryptoPP @@ MAEIPBII @ Z)
cryptlib.lib(integer.obj) :error LNK2001:未解析的外部符号public:virtual class CryptoPP :: Integer __thiscall CryptoPP :: AbstractGroup< class CryptoPP :: Integer> :: ScalarMultiply(class CryptoPP :: Integer const&,class CryptoPP :: Integer const& const(?ScalarMultiply @?$ AbstractGroup @ VInteger @ CryptoPP @@@ CryptoPP @@ UBE?AVInteger @ 2 @ ABV32 @ 0 @ Z)
cryptlib.lib(rsa.obj):error LNK2001:未解析的外部符号public class CryptoPP :: Integer __thiscall CryptoPP :: AbstractGroup< class CryptoPP :: Integer> :: ScalarMultiply(class CryptoPP :: Integer const&,class CryptoPP :: Integer const&)const(?ScalarMultiply @ $ abstractGroup @ VInteger @ CryptoPP @@@ CryptoPP @@ UBE?AVInteger @ 2 @ ABV32 @ 0 @ Z)
cryptlib.lib(integer.obj):error LNK2001:未解析的外部符号public:virtual class CryptoPP: :Integer __thiscall CryptoPP :: AbstractGroup< class CryptoPP :: Integer> :: CascadeScalarMultiply(class CryptoPP :: Integer const&,CryptoPP :: Integer const&,CryptoPP :: Integer const&,class CryptoPP :: Integer const&)const(?CascadeScalarMultiply @?$ AbstractGroup @ VInteger @ CryptoPP @@@ CryptoPP @@ UBE?AVInteger @ 2 @ ABV32 @ 000 @ Z)
cryptlib.lib(rsa.obj):error LNK2019 :未解析的外部符号public CryptoPP :: Integer __thiscall CryptoPP :: AbstractGroup< class CryptoPP :: Integer> :: CascadeScalarMultiply(class CryptoPP :: Integer const&,CryptoPP :: Integer const& :Integer const&,Class CryptoPP :: Integer const&)const(?CascadeScalarMultiply @?AbstractGroup @ VInteger @ CryptoPP @@@ CryptoPP @@UBE?AVInteger @ 2 @ ABV32 @ 000 @ Z) public:class CryptoPP :: GetValueHelperClass< class CryptoPP :: InvertibleRSAFunction,class CryptoPP :: RSAFunction> & __thiscall CryptoPP :: GetValueHelperClass< class CryptoPP :: InvertibleRSAFunction,class CryptoPP :: RSAFunction> :: operator()< class CryptoPP :: Integer>(char const *,class CryptoPP :: Integer const&(__thiscall CryptoPP :: InvertibleRSAFunction :: *)(void)const)(?? $?RVInteger @ CryptoPP @@@?$ GetValueHelperClass @ VInvertibleRSAFunction @ CryptoPP @@ VRSAFunction @ 2 @@ CryptoPP @@ QAEAAV01 @ PBDP8InvertibleRSAFunction @ 1 @ BEABVInteger @ 1 @ XZ @ Z)
cryptlib.lib(integer.obj):error LNK2001:未解析的外部符号public:virtual void __thiscall CryptoPP :: AbstractGroup< class CryptoPP :: Integer> :: SimultaneousMultiply(CryptoPP :: Integer CryptoPP :: Integer const&,class CryptoPP :: Integer const *,unsigned int)const(?SimultaneousMultiply @?AbstractGroup @ VInteger @ CryptoPP @@@ CryptoPP @@UBEXPAVInteger @ 2 @ ABV32 @ PBV32 @
cryptlib.lib(rsa.obj):error LNK2019:unresolved external symbolpublic:virtual void __thiscall CryptoPP :: AbstractGroup< class CryptoPP :: Integer> :: SimultaneousMultiply(CryptoPP :: Integer类,CryptoPP: :Integer const&,Class CryptoPP :: Integer const *,unsigned int)const(?SimultaneousMultiply @?$ AbstractGroup @ VInteger @ CryptoPP @@@ CryptoPP @@UBEXPAVInteger @ 2 @ ABV32 @ PBV32 @函数public:void __thiscall CryptoPP :: InvertibleRSAFunction :: Initialize(class CryptoPP :: Integer const&,class CryptoPP :: Integer const&,class CryptoPP :: Integer const&)(?Initialize @ InvertibleRSAFunction @ CryptoPP @ @ QAEXABVInteger @ 2 @ 00 @ Z)
cryptlib.lib(integer.obj):error LNK2019:未解析的外部符号public:virtual class CryptoPP :: Integer __thiscall CryptoPP :: AbstractRing< class CryptoPP :: Integer> ;: :Exponentiate(CryptoPP :: Integer const&,Class CryptoPP :: Integer const&)const(?Exponentiate @?$ AbstractRing @ VInteger @ CryptoPP @@@ CryptoPP @UBE?AVInteger @ 2 @ ABV32 @ Z)在函数中引用CryptoPP :: Integer __cdecl CryptoPP :: a_exp_b_mod_c(class CryptoPP :: Integer const&,class CryptoPP :: Integer const&,class CryptoPP :: Integer const&)(?a_exp_b_mod_c @ CryptoPP @@ YA?AVInteger @ 1 @ ABV21 @ 00 @ Z)
cryptlib.lib(rsa.obj):error LNK2001:未解析的外部符号public:virtual class CryptoPP :: Integer __thiscall CryptoPP :: AbstractRing& :: Integer> :: Exponentiate(CryptoPP :: Integer const&,class CryptoPP :: Integer const&)const(?Exponentiate @?$ AbstractRing @ VInteger @ CryptoPP @@@ CryptoPP @@UBE?AVInteger @ 2 @ ABV32 @ 0 @ Z)
cryptlib.lib(integer.obj):error LNK2019:未解析的外部符号public:CryptoPP :: Integer __thiscall CryptoPP :: AbstractRing< class CryptoPP :: Integer> :: CascadeExponentiate (CryptoPP :: Integer const&,class CryptoPP :: Integer const&,class CryptoPP :: Integer const&,class CryptoPP :: Integer const&)const(?CascadeExponentiate @?$ AbstractRing @ VInteger @ CryptoPP在函数public:virtual class CryptoPP :: Integer __thiscall中引用的函数CryptoPP :: @UBE?AVInteger @ 2 @ ABV32 @ 000 @ ZCryptoPP :: ModularArithmetic :: CascadeExponentiate(CryptoPP :: Integer const& :: Integer const&,Class CryptoPP :: Integer const&,class CryptoPP :: Integer const&)const(?CascadeExponentiate @ ModularArithmetic @ CryptoPP @@UBE?AVInteger @ 2 @ ABV32 @ 000 @ Z)
cryptlib.lib(integer.obj):error LNK2019:unresolved external symbolpublic:virtual void __thiscall CryptoPP :: AbstractRing< class CryptoPP :: Integer> :: SimultaneousExponentiate(CryptoPP :: Integer类,CryptoPP :: Integer在函数函数中引用的const&,class CryptoPP :: Integer const *,unsigned int)const(?SimultaneousExponentiate @?$ AbstractRing @ VInteger @ CryptoPP @@@ CryptoPP @UBEXPAVInteger @ 2 @ ABV32 @ PBV32 @ public:virtual void __thiscall CryptoPP :: ModularArithmetic :: SimultaneousExponentiate(class CryptoPP :: Integer *,class CryptoPP :: Integer const&,class CryptoPP :: Integer const *,unsigned int)const(?SimultaneousExponentiate @ ModularArithmetic @ CryptoPP @ @ UBEXPAVInteger @ 2 @ ABV32 @ PBV32 @ I @ Z)
cryptlib.lib(integer.obj):error LNK2001:未解析的外部符号public:virtual class CryptoPP :: Integer const& __thiscall CryptoPP :: AbstractEuclideanDomain< class CryptoPP :: Integer> :: Gcd(CryptoPP :: Integer const&,class CryptoPP :: Integer const&)const(?Gcd @?$ AbstractEuclideanDomain @ VInteger @ CryptoPP @@@ CryptoPP @@ UBEABVInteger @ 2 @ ABV32 @ 0 @ Z)
Release\PSGLicensing.dll:致命错误LNK1120:16未解决的外部
@


解决方案

这里是CryptLib的.pro文件的版本,其中的内部库是可链接的。

  QT  -  = core gui 
QMAKE_CFLAGS + = / Zc:wchar_t / GL

TEMPLATE = lib
TARGET = cryptlib

发布:DESTDIR = ./Release
调试:DESTDIR = ./Debug

CONFIG + = staticlib
DEFINES + = _USING_V110_SDK71_ WINVER = 0x0501 WIN32 _WINDOWS _MBCS USE_PRECOMPILED_HEADERS
DEFINES - = UNICODE

DEPENDPATH + =。

include(CryptoPP.pri)



因此,我所做的只是将 USE_PRECOMPILED_HEADERS 添加到DEFINES中,并删除了 PRECOMPILED_HEADER_FILE = pch.h 。我不知道它是如何帮助,但它有帮助。


Here is a preface - I have a C++ + Qt application, it consists of several projects and we are using MSVC 2012 to build it. Now, I'm implementing build scripts to start deploying build server. So, I started creating Qt .pro files for each and every project we have.

Now the problem - we use Crypto++ library(http://www.cryptopp.com/) which we build from source code and the output is static lib, and we have DLL which depends on cryptlib.lib.

I wrote .pro file for Cryptlib and I'm able to build it using qmake/jom

QT           -= core gui
QMAKE_CFLAGS += /Zc:wchar_t

TEMPLATE = lib
TARGET   = cryptlib

Release:DESTDIR = ./Release
Debug:DESTDIR   = ./Debug

CONFIG  += staticlib precompile_header
DEFINES += _USING_V110_SDK71_ WINVER=0x0501 WIN32 _WINDOWS _MBCS
DEFINES -= UNICODE

PRECOMPILED_HEADER = pch.h
DEPENDPATH += .

include(CryptoPP.pri)@

I wrote .pro file for my DLL - it compiles fine, but I'm getting linker errors on linkage phase. The most interesting thing is that when I build cryptlib with MSVC2012 and then build DLL with qmake - then it link OK.

What could be wrong? I checked all proj settings in MSVC projects and applied in my pro files. I checked names mangling in both libs built with MSVC and QT - mangled names look the same. Now I got stuck

@# ----------------------------------------------------
# This file is generated by the Qt Visual Studio Add-in.
# ------------------------------------------------------

QT           -= gui core
QMAKE_CFLAGS += /Zc:wchar_t

TEMPLATE = lib
TARGET   = PSGLicensing

Release:DESTDIR = ./Release
Debug:DESTDIR   = ./Debug

CONFIG  += dll
DEFINES += _AFXDLL _USING_V110_SDK71_ WIN32 _WINDOWS _WINDLL _USRDLL DLL_LIBRARY PSGLICENSING_DLL_BUILD _MBCS _VC80_UPGRADE=0x0710
DEFINES -= UNICODE

PRECOMPILED_HEADER = stdafx.h
DEPENDPATH += .

win32:CONFIG(release, debug|release): LIBS += -L$$_PRO_FILE_PWD_/../CryptoPP/Release/ -lcryptlib
else:win32:CONFIG(debug, debug|release): LIBS += -L$$_PRO_FILE_PWD_/../CryptoPP/Debug/ -lcryptlib

INCLUDEPATH += $$_PRO_FILE_PWD_/../CryptoPP/
DEPENDPATH += $$_PRO_FILE_PWD_/../CryptoPP/

win32:CONFIG(release, debug|release): PRE_TARGETDEPS += $$_PRO_FILE_PWD_/../CryptoPP/Release/cryptlib.lib
else:win32:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$_PRO_FILE_PWD_/../CryptoPP/Debug/cryptlib.lib

include(PSGLicensing.pri)@

In MSVC2012 we have following settings for

CryptLib

*Compiler:* /Yu"pch.h" /GS /GL /analyze- /W3 /Gy- /Zc:wchar_t /Zi /Gm- /O2 /Ob2 /Fd"Release\vc110.pdb" /fp:precise /Zp1 /D "_USING_V110_SDK71_" /D "NDEBUG" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /D "WIN32" /D "WINVER=0x0501" /D "_VC80_UPGRADE=0x0710" /errorReport:prompt /GF- /WX- /Zc:forScope /arch:SSE /Gd /Oy /Oi /MD /Fa"Release\" /EHsc /nologo /Fo"Release\" /Fp"Release\cryptlib.pch" 

*Linker:* /OUT:"SecretPath\CryptoPP\Release\cryptlib.lib" /LTCG /NOLOGO 

and here are settings for DLL

*Compiler*: /Yu"stdafx.h" /GS /analyze- /W3 /Zc:wchar_t /I"SecretPath\PSGLicensing\IncludeExp" /Zi /Gm- /O2 /Fd"Release\vc110.pdb" /fp:precise /D "_USING_V110_SDK71_" /D "WIN32" /D "_WINDOWS" /D "NDEBUG" /D "_USRDLL" /D "PSGLICENSING_DLL_BUILD" /D "_VC80_UPGRADE=0x0710" /D "_WINDLL" /D "_MBCS" /D "_AFXDLL" /errorReport:prompt /WX- /Zc:forScope /Gd /Oy- /MD /Fa"Release\" /EHsc /nologo /Fo"Release\" /Fp"Release\PSGLicensing.pch" 

*Linker:* /OUT:"SecretPah\PSGLicensing\Release\PSGLicensing.dll" /MANIFEST /PDB:"SecretPath\PSGLicensing\Release\PSGLicensing.pdb" /DYNAMICBASE:NO "..\CryptoPP\Release\cryptlib.lib" "SecretPath\CryptoPP\Release\cryptlib.lib" /DEF:".\PSGLicensing.def" /IMPLIB:"SecretPath\PSGLicensing\Release\PSGLicensing.lib" /DEBUG /DLL /MACHINE:X86 /OPT:REF /SAFESEH /INCREMENTAL:NO /PGD:"SecretPath\PSGLicensing\Release\PSGLicensing.pgd" /SUBSYSTEM:WINDOWS",5.01" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:"Release\PSGLicensing.dll.intermediate.manifest" /OPT:ICF /ERRORREPORT:PROMPT /NOLOGO /TLBID:1 

Here is jom output

@   C:\Qt\Qt5.2.1\Tools\QtCreator\bin\jom.exe -f Makefile.Release
    link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /DLL /MANIFEST /MANIFESTFILE:Release\PSGLicensing.dll.embed.manifest /OUT:Release\PSGLicensing.dll @C:\Users\ANDRIY~1.GLO\AppData\Local\Temp\PSGLicensing.dll.6212.16.jom
   Creating library Release\PSGLicensing.lib and object Release\PSGLicensing.exp
GenerateRandomBlock.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CryptoPP::CFB_CipherTemplate<class CryptoPP::AbstractPolicyHolder<class CryptoPP::CFB_CipherAbstractPolicy,class CryptoPP::CFB_ModePolicy> >::ProcessData(unsigned char *,unsigned char const *,unsigned int)" (?ProcessData@?$CFB_CipherTemplate@V?$AbstractPolicyHolder@VCFB_CipherAbstractPolicy@CryptoPP@@VCFB_ModePolicy@2@@CryptoPP@@@CryptoPP@@UAEXPAEPBEI@Z)
GenerateRandomBlock.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CryptoPP::CFB_CipherTemplate<class CryptoPP::AbstractPolicyHolder<class CryptoPP::CFB_CipherAbstractPolicy,class CryptoPP::CFB_ModePolicy> >::Resynchronize(unsigned char const *,int)" (?Resynchronize@?$CFB_CipherTemplate@V?$AbstractPolicyHolder@VCFB_CipherAbstractPolicy@CryptoPP@@VCFB_ModePolicy@2@@CryptoPP@@@CryptoPP@@UAEXPBEH@Z)
GenerateRandomBlock.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall CryptoPP::CFB_CipherTemplate<class CryptoPP::AbstractPolicyHolder<class CryptoPP::CFB_CipherAbstractPolicy,class CryptoPP::CFB_ModePolicy> >::UncheckedSetKey(unsigned char const *,unsigned int,class CryptoPP::NameValuePairs const &)" (?UncheckedSetKey@?$CFB_CipherTemplate@V?$AbstractPolicyHolder@VCFB_CipherAbstractPolicy@CryptoPP@@VCFB_ModePolicy@2@@CryptoPP@@@CryptoPP@@MAEXPBEIABVNameValuePairs@2@@Z)
GenerateRandomBlock.obj : error LNK2001: unresolved external symbol "private: virtual void __thiscall CryptoPP::CFB_EncryptionTemplate<class CryptoPP::AbstractPolicyHolder<class CryptoPP::CFB_CipherAbstractPolicy,class CryptoPP::CFB_ModePolicy> >::CombineMessageAndShiftRegister(unsigned char *,unsigned char *,unsigned char const *,unsigned int)" (?CombineMessageAndShiftRegister@?$CFB_EncryptionTemplate@V?$AbstractPolicyHolder@VCFB_CipherAbstractPolicy@CryptoPP@@VCFB_ModePolicy@2@@CryptoPP@@@CryptoPP@@EAEXPAE0PBEI@Z)
cryptlib.lib(rsa.obj) : error LNK2001: unresolved external symbol "public: virtual void __thiscall CryptoPP::IteratedHashBase<unsigned int,class CryptoPP::HashTransformation>::Update(unsigned char const *,unsigned int)" (?Update@?$IteratedHashBase@IVHashTransformation@CryptoPP@@@CryptoPP@@UAEXPBEI@Z)
LicensingEx.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CryptoPP::IteratedHashBase<unsigned int,class CryptoPP::HashTransformation>::Update(unsigned char const *,unsigned int)" (?Update@?$IteratedHashBase@IVHashTransformation@CryptoPP@@@CryptoPP@@UAEXPBEI@Z)
cryptlib.lib(randpool.obj) : error LNK2001: unresolved external symbol "public: virtual void __thiscall CryptoPP::IteratedHashBase<unsigned int,class CryptoPP::HashTransformation>::Update(unsigned char const *,unsigned int)" (?Update@?$IteratedHashBase@IVHashTransformation@CryptoPP@@@CryptoPP@@UAEXPBEI@Z)
cryptlib.lib(md5.obj) : error LNK2001: unresolved external symbol "public: virtual void __thiscall CryptoPP::IteratedHashBase<unsigned int,class CryptoPP::HashTransformation>::Update(unsigned char const *,unsigned int)" (?Update@?$IteratedHashBase@IVHashTransformation@CryptoPP@@@CryptoPP@@UAEXPBEI@Z)
cryptlib.lib(integer.obj) : error LNK2001: unresolved external symbol "public: virtual void __thiscall CryptoPP::IteratedHashBase<unsigned int,class CryptoPP::HashTransformation>::Update(unsigned char const *,unsigned int)" (?Update@?$IteratedHashBase@IVHashTransformation@CryptoPP@@@CryptoPP@@UAEXPBEI@Z)
cryptlib.lib(rsa.obj) : error LNK2001: unresolved external symbol "public: virtual unsigned char * __thiscall CryptoPP::IteratedHashBase<unsigned int,class CryptoPP::HashTransformation>::CreateUpdateSpace(unsigned int &)" (?CreateUpdateSpace@?$IteratedHashBase@IVHashTransformation@CryptoPP@@@CryptoPP@@UAEPAEAAI@Z)
LicensingEx.obj : error LNK2001: unresolved external symbol "public: virtual unsigned char * __thiscall CryptoPP::IteratedHashBase<unsigned int,class CryptoPP::HashTransformation>::CreateUpdateSpace(unsigned int &)" (?CreateUpdateSpace@?$IteratedHashBase@IVHashTransformation@CryptoPP@@@CryptoPP@@UAEPAEAAI@Z)
cryptlib.lib(randpool.obj) : error LNK2001: unresolved external symbol "public: virtual unsigned char * __thiscall CryptoPP::IteratedHashBase<unsigned int,class CryptoPP::HashTransformation>::CreateUpdateSpace(unsigned int &)" (?CreateUpdateSpace@?$IteratedHashBase@IVHashTransformation@CryptoPP@@@CryptoPP@@UAEPAEAAI@Z)
cryptlib.lib(md5.obj) : error LNK2001: unresolved external symbol "public: virtual unsigned char * __thiscall CryptoPP::IteratedHashBase<unsigned int,class CryptoPP::HashTransformation>::CreateUpdateSpace(unsigned int &)" (?CreateUpdateSpace@?$IteratedHashBase@IVHashTransformation@CryptoPP@@@CryptoPP@@UAEPAEAAI@Z)
cryptlib.lib(integer.obj) : error LNK2001: unresolved external symbol "public: virtual unsigned char * __thiscall CryptoPP::IteratedHashBase<unsigned int,class CryptoPP::HashTransformation>::CreateUpdateSpace(unsigned int &)" (?CreateUpdateSpace@?$IteratedHashBase@IVHashTransformation@CryptoPP@@@CryptoPP@@UAEPAEAAI@Z)
cryptlib.lib(rsa.obj) : error LNK2001: unresolved external symbol "public: virtual void __thiscall CryptoPP::IteratedHashBase<unsigned int,class CryptoPP::HashTransformation>::Restart(void)" (?Restart@?$IteratedHashBase@IVHashTransformation@CryptoPP@@@CryptoPP@@UAEXXZ)
LicensingEx.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CryptoPP::IteratedHashBase<unsigned int,class CryptoPP::HashTransformation>::Restart(void)" (?Restart@?$IteratedHashBase@IVHashTransformation@CryptoPP@@@CryptoPP@@UAEXXZ)
cryptlib.lib(randpool.obj) : error LNK2001: unresolved external symbol "public: virtual void __thiscall CryptoPP::IteratedHashBase<unsigned int,class CryptoPP::HashTransformation>::Restart(void)" (?Restart@?$IteratedHashBase@IVHashTransformation@CryptoPP@@@CryptoPP@@UAEXXZ)
cryptlib.lib(md5.obj) : error LNK2001: unresolved external symbol "public: virtual void __thiscall CryptoPP::IteratedHashBase<unsigned int,class CryptoPP::HashTransformation>::Restart(void)" (?Restart@?$IteratedHashBase@IVHashTransformation@CryptoPP@@@CryptoPP@@UAEXXZ)
cryptlib.lib(integer.obj) : error LNK2001: unresolved external symbol "public: virtual void __thiscall CryptoPP::IteratedHashBase<unsigned int,class CryptoPP::HashTransformation>::Restart(void)" (?Restart@?$IteratedHashBase@IVHashTransformation@CryptoPP@@@CryptoPP@@UAEXXZ)
cryptlib.lib(rsa.obj) : error LNK2001: unresolved external symbol "public: virtual void __thiscall CryptoPP::IteratedHashBase<unsigned int,class CryptoPP::HashTransformation>::TruncatedFinal(unsigned char *,unsigned int)" (?TruncatedFinal@?$IteratedHashBase@IVHashTransformation@CryptoPP@@@CryptoPP@@UAEXPAEI@Z)
LicensingEx.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CryptoPP::IteratedHashBase<unsigned int,class CryptoPP::HashTransformation>::TruncatedFinal(unsigned char *,unsigned int)" (?TruncatedFinal@?$IteratedHashBase@IVHashTransformation@CryptoPP@@@CryptoPP@@UAEXPAEI@Z)
cryptlib.lib(randpool.obj) : error LNK2001: unresolved external symbol "public: virtual void __thiscall CryptoPP::IteratedHashBase<unsigned int,class CryptoPP::HashTransformation>::TruncatedFinal(unsigned char *,unsigned int)" (?TruncatedFinal@?$IteratedHashBase@IVHashTransformation@CryptoPP@@@CryptoPP@@UAEXPAEI@Z)
cryptlib.lib(md5.obj) : error LNK2001: unresolved external symbol "public: virtual void __thiscall CryptoPP::IteratedHashBase<unsigned int,class CryptoPP::HashTransformation>::TruncatedFinal(unsigned char *,unsigned int)" (?TruncatedFinal@?$IteratedHashBase@IVHashTransformation@CryptoPP@@@CryptoPP@@UAEXPAEI@Z)
cryptlib.lib(integer.obj) : error LNK2001: unresolved external symbol "public: virtual void __thiscall CryptoPP::IteratedHashBase<unsigned int,class CryptoPP::HashTransformation>::TruncatedFinal(unsigned char *,unsigned int)" (?TruncatedFinal@?$IteratedHashBase@IVHashTransformation@CryptoPP@@@CryptoPP@@UAEXPAEI@Z)
LicensingEx.obj : error LNK2001: unresolved external symbol "protected: virtual unsigned int __thiscall CryptoPP::IteratedHashBase<unsigned int,class CryptoPP::HashTransformation>::HashMultipleBlocks(unsigned int const *,unsigned int)" (?HashMultipleBlocks@?$IteratedHashBase@IVHashTransformation@CryptoPP@@@CryptoPP@@MAEIPBII@Z)
cryptlib.lib(md5.obj) : error LNK2001: unresolved external symbol "protected: virtual unsigned int __thiscall CryptoPP::IteratedHashBase<unsigned int,class CryptoPP::HashTransformation>::HashMultipleBlocks(unsigned int const *,unsigned int)" (?HashMultipleBlocks@?$IteratedHashBase@IVHashTransformation@CryptoPP@@@CryptoPP@@MAEIPBII@Z)
cryptlib.lib(integer.obj) : error LNK2001: unresolved external symbol "protected: virtual unsigned int __thiscall CryptoPP::IteratedHashBase<unsigned int,class CryptoPP::HashTransformation>::HashMultipleBlocks(unsigned int const *,unsigned int)" (?HashMultipleBlocks@?$IteratedHashBase@IVHashTransformation@CryptoPP@@@CryptoPP@@MAEIPBII@Z)
cryptlib.lib(rsa.obj) : error LNK2001: unresolved external symbol "protected: virtual unsigned int __thiscall CryptoPP::IteratedHashBase<unsigned int,class CryptoPP::HashTransformation>::HashMultipleBlocks(unsigned int const *,unsigned int)" (?HashMultipleBlocks@?$IteratedHashBase@IVHashTransformation@CryptoPP@@@CryptoPP@@MAEIPBII@Z)
cryptlib.lib(integer.obj) : error LNK2001: unresolved external symbol "public: virtual class CryptoPP::Integer __thiscall CryptoPP::AbstractGroup<class CryptoPP::Integer>::ScalarMultiply(class CryptoPP::Integer const &,class CryptoPP::Integer const &)const " (?ScalarMultiply@?$AbstractGroup@VInteger@CryptoPP@@@CryptoPP@@UBE?AVInteger@2@ABV32@0@Z)
cryptlib.lib(rsa.obj) : error LNK2001: unresolved external symbol "public: virtual class CryptoPP::Integer __thiscall CryptoPP::AbstractGroup<class CryptoPP::Integer>::ScalarMultiply(class CryptoPP::Integer const &,class CryptoPP::Integer const &)const " (?ScalarMultiply@?$AbstractGroup@VInteger@CryptoPP@@@CryptoPP@@UBE?AVInteger@2@ABV32@0@Z)
cryptlib.lib(integer.obj) : error LNK2001: unresolved external symbol "public: virtual class CryptoPP::Integer __thiscall CryptoPP::AbstractGroup<class CryptoPP::Integer>::CascadeScalarMultiply(class CryptoPP::Integer const &,class CryptoPP::Integer const &,class CryptoPP::Integer const &,class CryptoPP::Integer const &)const " (?CascadeScalarMultiply@?$AbstractGroup@VInteger@CryptoPP@@@CryptoPP@@UBE?AVInteger@2@ABV32@000@Z)
cryptlib.lib(rsa.obj) : error LNK2019: unresolved external symbol "public: virtual class CryptoPP::Integer __thiscall CryptoPP::AbstractGroup<class CryptoPP::Integer>::CascadeScalarMultiply(class CryptoPP::Integer const &,class CryptoPP::Integer const &,class CryptoPP::Integer const &,class CryptoPP::Integer const &)const " (?CascadeScalarMultiply@?$AbstractGroup@VInteger@CryptoPP@@@CryptoPP@@UBE?AVInteger@2@ABV32@000@Z) referenced in function "public: class CryptoPP::GetValueHelperClass<class CryptoPP::InvertibleRSAFunction,class CryptoPP::RSAFunction> & __thiscall CryptoPP::GetValueHelperClass<class CryptoPP::InvertibleRSAFunction,class CryptoPP::RSAFunction>::operator()<class CryptoPP::Integer>(char const *,class CryptoPP::Integer const & (__thiscall CryptoPP::InvertibleRSAFunction::*)(void)const )" (??$?RVInteger@CryptoPP@@@?$GetValueHelperClass@VInvertibleRSAFunction@CryptoPP@@VRSAFunction@2@@CryptoPP@@QAEAAV01@PBDP8InvertibleRSAFunction@1@BEABVInteger@1@XZ@Z)
cryptlib.lib(integer.obj) : error LNK2001: unresolved external symbol "public: virtual void __thiscall CryptoPP::AbstractGroup<class CryptoPP::Integer>::SimultaneousMultiply(class CryptoPP::Integer *,class CryptoPP::Integer const &,class CryptoPP::Integer const *,unsigned int)const " (?SimultaneousMultiply@?$AbstractGroup@VInteger@CryptoPP@@@CryptoPP@@UBEXPAVInteger@2@ABV32@PBV32@I@Z)
cryptlib.lib(rsa.obj) : error LNK2019: unresolved external symbol "public: virtual void __thiscall CryptoPP::AbstractGroup<class CryptoPP::Integer>::SimultaneousMultiply(class CryptoPP::Integer *,class CryptoPP::Integer const &,class CryptoPP::Integer const *,unsigned int)const " (?SimultaneousMultiply@?$AbstractGroup@VInteger@CryptoPP@@@CryptoPP@@UBEXPAVInteger@2@ABV32@PBV32@I@Z) referenced in function "public: void __thiscall CryptoPP::InvertibleRSAFunction::Initialize(class CryptoPP::Integer const &,class CryptoPP::Integer const &,class CryptoPP::Integer const &)" (?Initialize@InvertibleRSAFunction@CryptoPP@@QAEXABVInteger@2@00@Z)
cryptlib.lib(integer.obj) : error LNK2019: unresolved external symbol "public: virtual class CryptoPP::Integer __thiscall CryptoPP::AbstractRing<class CryptoPP::Integer>::Exponentiate(class CryptoPP::Integer const &,class CryptoPP::Integer const &)const " (?Exponentiate@?$AbstractRing@VInteger@CryptoPP@@@CryptoPP@@UBE?AVInteger@2@ABV32@0@Z) referenced in function "class CryptoPP::Integer __cdecl CryptoPP::a_exp_b_mod_c(class CryptoPP::Integer const &,class CryptoPP::Integer const &,class CryptoPP::Integer const &)" (?a_exp_b_mod_c@CryptoPP@@YA?AVInteger@1@ABV21@00@Z)
cryptlib.lib(rsa.obj) : error LNK2001: unresolved external symbol "public: virtual class CryptoPP::Integer __thiscall CryptoPP::AbstractRing<class CryptoPP::Integer>::Exponentiate(class CryptoPP::Integer const &,class CryptoPP::Integer const &)const " (?Exponentiate@?$AbstractRing@VInteger@CryptoPP@@@CryptoPP@@UBE?AVInteger@2@ABV32@0@Z)
cryptlib.lib(integer.obj) : error LNK2019: unresolved external symbol "public: virtual class CryptoPP::Integer __thiscall CryptoPP::AbstractRing<class CryptoPP::Integer>::CascadeExponentiate(class CryptoPP::Integer const &,class CryptoPP::Integer const &,class CryptoPP::Integer const &,class CryptoPP::Integer const &)const " (?CascadeExponentiate@?$AbstractRing@VInteger@CryptoPP@@@CryptoPP@@UBE?AVInteger@2@ABV32@000@Z) referenced in function "public: virtual class CryptoPP::Integer __thiscall CryptoPP::ModularArithmetic::CascadeExponentiate(class CryptoPP::Integer const &,class CryptoPP::Integer const &,class CryptoPP::Integer const &,class CryptoPP::Integer const &)const " (?CascadeExponentiate@ModularArithmetic@CryptoPP@@UBE?AVInteger@2@ABV32@000@Z)
cryptlib.lib(integer.obj) : error LNK2019: unresolved external symbol "public: virtual void __thiscall CryptoPP::AbstractRing<class CryptoPP::Integer>::SimultaneousExponentiate(class CryptoPP::Integer *,class CryptoPP::Integer const &,class CryptoPP::Integer const *,unsigned int)const " (?SimultaneousExponentiate@?$AbstractRing@VInteger@CryptoPP@@@CryptoPP@@UBEXPAVInteger@2@ABV32@PBV32@I@Z) referenced in function "public: virtual void __thiscall CryptoPP::ModularArithmetic::SimultaneousExponentiate(class CryptoPP::Integer *,class CryptoPP::Integer const &,class CryptoPP::Integer const *,unsigned int)const " (?SimultaneousExponentiate@ModularArithmetic@CryptoPP@@UBEXPAVInteger@2@ABV32@PBV32@I@Z)
cryptlib.lib(integer.obj) : error LNK2001: unresolved external symbol "public: virtual class CryptoPP::Integer const & __thiscall CryptoPP::AbstractEuclideanDomain<class CryptoPP::Integer>::Gcd(class CryptoPP::Integer const &,class CryptoPP::Integer const &)const " (?Gcd@?$AbstractEuclideanDomain@VInteger@CryptoPP@@@CryptoPP@@UBEABVInteger@2@ABV32@0@Z)
Release\PSGLicensing.dll : fatal error LNK1120: 16 unresolved externals
@

解决方案

Here is the version of .pro file for CryptLib with which built library is linkable.

QT           -= core gui
QMAKE_CFLAGS += /Zc:wchar_t /GL

TEMPLATE = lib
TARGET   = cryptlib

Release:DESTDIR = ./Release
Debug:DESTDIR   = ./Debug

CONFIG  += staticlib
DEFINES += _USING_V110_SDK71_ WINVER=0x0501 WIN32 _WINDOWS _MBCS USE_PRECOMPILED_HEADERS
DEFINES -= UNICODE

DEPENDPATH += .

include(CryptoPP.pri)

So, all I did is added USE_PRECOMPILED_HEADERS to DEFINES and removed PRECOMPILED_HEADER_FILE = pch.h. I do not know how it actually helped, but it helped.

这篇关于链接器错误时构建DLL依赖于静态lib Crypto ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆