这是一个前言 - 我有一个C ++ + Qt应用程序,它由几个项目组成,我们正在使用MSVC 2012来构建它。现在,我正在实现构建脚本以开始部署构建服务器。所以,我开始为我们拥有的每个项目创建Qt .pro文件。
现在问题 - 我们使用Crypto ++库(http://www.cryptopp.com/),我们从源代码构建,输出是静态库,我们有依赖cryptlib.lib的DLL。
我为Cryptlib写了.pro文件,我可以使用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)@
我为我的DLL写了.pro文件 - 它编译得很好,但我在链接阶段上遇到链接器错误。最有趣的是,当我使用MSVC2012和构建cryptlib然后使用qmake构建DLL时 - 然后链接OK。
可能有什么不对?我检查了MSVC项目中的所有项目设置并应用于我的专业文件中。我检查了在使用MSVC和QT构建的库中的名称损坏 - 受损的名称看起来相同。现在我卡住了
@# ----------------------------------------------------
# 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)@
在MSVC2012中,我们有
的以下设置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
以下是 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
这是jom输出
@ 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
@
答案 0 :(得分:1)
以下是CryptLib的.pro文件版本,其中构建的库可以链接。
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)
所以,我所做的就是将 USE_PRECOMPILED_HEADERS 添加到DEFINES并删除 PRECOMPILED_HEADER_FILE = pch.h 。我不知道它究竟是如何起作用的,但它有所帮助。