5

我正在使用 Chilkat 库编写一个 C++ 程序。我已将整个库链接到项目,如下所示:

project > properties > C/C++ > General > Additional Include Directories > C:\chilkat\include  (That's where I have the library)

project > properties > Linker > Input > Additional Dependencies >  ...  C:\chilkat\libs\ChilkatDbgDll.lib; ...

Chilkat 库带有 4 种 .lib 文件,每种用于不同类型的运行时,所以我使用了最适合我的项目的 .lib(多线程调试 DLL)。

该死的东西仍然给我这个:

    1>------ Build started: Project: botnet, Configuration: Debug Win32 ------
    1>Build started 28.08.2013 20:47:29.
    1>InitializeBuildStatus:
    1>  Touching "Debug\botnet.unsuccessfulbuild".
    1>ClCompile:
    1>  botnet.cpp
    1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__getsockopt@20 referenced in function "public: void __thiscall ChilkatSocket::logSocketOptions(class LogBase &)" (?logSocketOptions@ChilkatSocket@@QAEXAAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__setsockopt@20 referenced in function "private: void __thiscall ChilkatSocket::checkSetBufSizes(class LogBase &)" (?checkSetBufSizes@ChilkatSocket@@AAEXAAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__accept@12 referenced in function "private: bool __thiscall ChilkatSocket::acceptNextConnection2(class ChilkatSocket &,bool,unsigned int,class LogBase &,bool &)" (?acceptNextConnection2@ChilkatSocket@@AAE_NAAV1@_NIAAVLogBase@@AA_N@Z)
    1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__ioctlsocket@12 referenced in function "public: void __thiscall ChilkatSocket::setNonBlocking(void)" (?setNonBlocking@ChilkatSocket@@QAEXXZ)
    1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__WSAGetLastError@0 referenced in function "private: bool __thiscall ChilkatSocket::createSocket_ipv4(class LogBase &,bool)" (?createSocket_ipv4@ChilkatSocket@@AAE_NAAVLogBase@@_N@Z)
    1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__socket@12 referenced in function "private: bool __thiscall ChilkatSocket::createSocket_ipv4(class LogBase &,bool)" (?createSocket_ipv4@ChilkatSocket@@AAE_NAAVLogBase@@_N@Z)
    1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__WSAStartup@8 referenced in function "bool __cdecl startupWSA(class LogBase &)" (?startupWSA@@YA_NAAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__ntohs@4 referenced in function "private: bool __thiscall ChilkatSocket::ck_getsockname_ipv4(class chilkat::StringBuffer &,int &,class LogBase &)" (?ck_getsockname_ipv4@ChilkatSocket@@AAE_NAAVStringBuffer@chilkat@@AAHAAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__inet_ntoa@4 referenced in function "private: bool __thiscall ChilkatSocket::ck_getsockname_ipv4(class chilkat::StringBuffer &,int &,class LogBase &)" (?ck_getsockname_ipv4@ChilkatSocket@@AAE_NAAVStringBuffer@chilkat@@AAHAAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__getsockname@12 referenced in function "private: bool __thiscall ChilkatSocket::ck_getsockname_ipv4(class chilkat::StringBuffer &,int &,class LogBase &)" (?ck_getsockname_ipv4@ChilkatSocket@@AAE_NAAVStringBuffer@chilkat@@AAHAAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__gethostbyname@4 referenced in function "struct hostent * __cdecl ck_gethostbyname(char const *,class LogBase &)" (?ck_gethostbyname@@YAPAUhostent@@PBDAAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(HostnameResolve.obj) : error LNK2001: unresolved external symbol __imp__gethostbyname@4
    1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__getpeername@12 referenced in function "public: bool __thiscall ChilkatSocket::GetPeerName(class chilkat::StringBuffer &,int &)" (?GetPeerName@ChilkatSocket@@QAE_NAAVStringBuffer@chilkat@@AAH@Z)
    1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__inet_addr@4 referenced in function "public: static bool __cdecl ChilkatSocket::isDottedIpAddress(char const *)" (?isDottedIpAddress@ChilkatSocket@@SA_NPBD@Z)
    1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__htons@4 referenced in function "public: static bool __cdecl ChilkatSocket::isDottedIpAddress(char const *)" (?isDottedIpAddress@ChilkatSocket@@SA_NPBD@Z)
    1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__connect@12 referenced in function "private: bool __thiscall ChilkatSocket::connectSocket2_ipv4(char const *,int,unsigned int,class LogBase &,class ProgressMonitor *,bool &)" (?connectSocket2_ipv4@ChilkatSocket@@AAE_NPBDHIAAVLogBase@@PAVProgressMonitor@@AA_N@Z)
    1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__select@20 referenced in function "public: bool __thiscall ChilkatSocket::waitWriteable2(unsigned int,class LogBase &)" (?waitWriteable2@ChilkatSocket@@QAE_NIAAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol ___WSAFDIsSet@8 referenced in function "public: bool __thiscall ChilkatSocket::waitWriteableMs2(unsigned int,bool,class SocketParams &,class LogBase &)" (?waitWriteableMs2@ChilkatSocket@@QAE_NI_NAAVSocketParams@@AAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__bind@12 referenced in function "private: bool __thiscall ChilkatSocket::bindSysCall2(void *,int,class LogBase &)" (?bindSysCall2@ChilkatSocket@@AAE_NPAXHAAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__listen@8 referenced in function "public: bool __thiscall ChilkatSocket::listenOnPort(int &,int,bool,class LogBase &)" (?listenOnPort@ChilkatSocket@@QAE_NAAHH_NAAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__gethostname@8 referenced in function "private: static bool __cdecl ChilkatSocket::getLocalHostName_inner(class chilkat::StringBuffer &,class LogBase &)" (?getLocalHostName_inner@ChilkatSocket@@CA_NAAVStringBuffer@chilkat@@AAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__closesocket@4 referenced in function "public: bool __thiscall ChilkatSocket::NewSocketAndListen(bool,class LogBase &)" (?NewSocketAndListen@ChilkatSocket@@QAE_N_NAAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__shutdown@8 referenced in function "public: bool __thiscall ChilkatSocket::NewSocketAndListen(bool,class LogBase &)" (?NewSocketAndListen@ChilkatSocket@@QAE_N_NAAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__recv@16 referenced in function "public: bool __thiscall ChilkatSocket::IsConnected(class LogBase &)" (?IsConnected@ChilkatSocket@@QAE_NAAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__send@16 referenced in function "public: bool __thiscall ChilkatSocket::SendBytes2(unsigned char const *,unsigned int,unsigned int,unsigned int,class LogBase &,class SocketParams &)" (?SendBytes2@ChilkatSocket@@QAE_NPBEIIIAAVLogBase@@AAVSocketParams@@@Z)
    1>ChilkatDbgDll.lib(MsCertificate.obj) : error LNK2019: unresolved external symbol __imp__CertVerifyRevocation@28 referenced in function "public: int __thiscall MsCertificate::checkRevoked(class LogBase &)" (?checkRevoked@MsCertificate@@QAEHAAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(MsCertificate.obj) : error LNK2019: unresolved external symbol __imp__CertFreeCertificateContext@4 referenced in function "public: void __thiscall MsCertificate::dotNetDispose(void)" (?dotNetDispose@MsCertificate@@QAEXXZ)
    1>ChilkatDbgDll.lib(CertificateStore.obj) : error LNK2001: unresolved external symbol __imp__CertFreeCertificateContext@4
    1>ChilkatDbgDll.lib(_ckMsCrypto.obj) : error LNK2001: unresolved external symbol __imp__CertFreeCertificateContext@4
    1>ChilkatDbgDll.lib(MsCertificate.obj) : error LNK2019: unresolved external symbol __imp__CertNameToStrW@20 referenced in function "void __cdecl _getCertNameStr(struct _CRYPTOAPI_BLOB *,unsigned long,class XString &)" (?_getCertNameStr@@YAXPAU_CRYPTOAPI_BLOB@@KAAVXString@@@Z)
    1>ChilkatDbgDll.lib(MsCertificate.obj) : error LNK2019: unresolved external symbol __imp__CertDuplicateCertificateContext@4 referenced in function "public: __thiscall MsCertificate::MsCertificate(struct _CERT_CONTEXT const *,bool,class LogBase &)" (??0MsCertificate@@QAE@PBU_CERT_CONTEXT@@_NAAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(CertificateStore.obj) : error LNK2001: unresolved external symbol __imp__CertDuplicateCertificateContext@4
    1>ChilkatDbgDll.lib(MsCertificate.obj) : error LNK2019: unresolved external symbol __imp__CertSetCertificateContextProperty@16 referenced in function "public: bool __thiscall MsCertificate::linkPrivateKey(class XString &,bool,bool,class LogBase &)" (?linkPrivateKey@MsCertificate@@QAE_NAAVXString@@_N1AAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(CertificateStore.obj) : error LNK2001: unresolved external symbol __imp__CertSetCertificateContextProperty@16
    1>ChilkatDbgDll.lib(MsCertificate.obj) : error LNK2019: unresolved external symbol __imp__CryptDecodeObject@28 referenced in function "public: static void __cdecl MsCertificate::getRfc822NameFromContext(struct _CERT_CONTEXT const *,class XString &)" (?getRfc822NameFromContext@MsCertificate@@SAXPBU_CERT_CONTEXT@@AAVXString@@@Z)
    1>ChilkatDbgDll.lib(MsCertificate.obj) : error LNK2019: unresolved external symbol __imp__CertGetIntendedKeyUsage@16 referenced in function "public: unsigned int __thiscall MsCertificate::getIntendedKeyUsage(void)" (?getIntendedKeyUsage@MsCertificate@@QAEIXZ)
    1>ChilkatDbgDll.lib(MsCertificate.obj) : error LNK2019: unresolved external symbol __imp__CertGetCertificateContextProperty@16 referenced in function "private: bool __thiscall MsCertificate::getKeyProviderInfo(int,class LogBase &)" (?getKeyProviderInfo@MsCertificate@@AAE_NHAAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(_ckMsCrypto.obj) : error LNK2001: unresolved external symbol __imp__CertGetCertificateContextProperty@16
    1>ChilkatDbgDll.lib(MsCertificate.obj) : error LNK2019: unresolved external symbol __imp__CertCreateCertificateContext@12 referenced in function "public: static class MsCertificate * __cdecl MsCertificate::createFromDer(unsigned char const *,unsigned int,class LogBase &)" (?createFromDer@MsCertificate@@SAPAV1@PBEIAAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(CertificateStore.obj) : error LNK2019: unresolved external symbol __imp__CertDuplicateStore@4 referenced in function "public: class CertificateStore * __thiscall CertificateStore::dupStore(class LogBase *)" (?dupStore@CertificateStore@@QAEPAV1@PAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(CertificateStore.obj) : error LNK2019: unresolved external symbol __imp__CertEnumCertificatesInStore@8 referenced in function "private: void __thiscall CertificateStore::deleteKeyContainers(void)" (?deleteKeyContainers@CertificateStore@@AAEXXZ)
    1>ChilkatDbgDll.lib(CertificateStore.obj) : error LNK2019: unresolved external symbol __imp__CertCloseStore@8 referenced in function "public: void __thiscall CertificateStore::dotNetDispose(void)" (?dotNetDispose@CertificateStore@@QAEXXZ)
    1>ChilkatDbgDll.lib(_ckMsCrypto.obj) : error LNK2001: unresolved external symbol __imp__CertCloseStore@8
    1>ChilkatDbgDll.lib(CertificateStore.obj) : error LNK2019: unresolved external symbol __imp__CertOpenStore@20 referenced in function "public: static class CertificateStore * __cdecl CertificateStore::createMemoryStore(class LogBase *)" (?createMemoryStore@CertificateStore@@SAPAV1@PAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(_ckMsCrypto.obj) : error LNK2001: unresolved external symbol __imp__CertOpenStore@20
    1>ChilkatDbgDll.lib(CertificateStore.obj) : error LNK2019: unresolved external symbol __imp__CertFindCertificateInStore@24 referenced in function "public: class MsCertificate * __thiscall CertificateStore::findIssuer(class MsCertificate &,class LogBase &,bool)" (?findIssuer@CertificateStore@@QAEPAVMsCertificate@@AAV2@AAVLogBase@@_N@Z)
    1>ChilkatDbgDll.lib(CertificateStore.obj) : error LNK2019: unresolved external symbol __imp__CertAddEncodedCertificateToStore@24 referenced in function "public: bool __thiscall CertificateStore::addEncodedCertificateUtf8(char const *,class LogBase &)" (?addEncodedCertificateUtf8@CertificateStore@@QAE_NPBDAAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(CertificateStore.obj) : error LNK2019: unresolved external symbol __imp__CertAddCertificateContextToStore@16 referenced in function "public: bool __thiscall CertificateStore::addCertWithPrivateKey(class MsCertificate &,class XString &,bool,class LogBase &,bool)" (?addCertWithPrivateKey@CertificateStore@@QAE_NAAVMsCertificate@@AAVXString@@_NAAVLogBase@@2@Z)
    1>ChilkatDbgDll.lib(CertificateStore.obj) : error LNK2019: unresolved external symbol __imp__CertSaveStore@24 referenced in function "private: bool __thiscall CertificateStore::saveCertStore(class LogBase &)" (?saveCertStore@CertificateStore@@AAE_NAAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(CertificateStore.obj) : error LNK2019: unresolved external symbol __imp__CertDeleteCertificateFromStore@4 referenced in function "public: bool __thiscall CertificateStore::removeCertificate(class MsCertificate *,class LogBase &)" (?removeCertificate@CertificateStore@@QAE_NPAVMsCertificate@@AAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(CertificateStore.obj) : error LNK2019: unresolved external symbol __imp__CertGetSubjectCertificateFromStore@12 referenced in function "public: class MsCertificate * __thiscall CertificateStore::findCertificate(struct _CERT_INFO *)" (?findCertificate@CertificateStore@@QAEPAVMsCertificate@@PAU_CERT_INFO@@@Z)
    1>ChilkatDbgDll.lib(_ckMsCrypto.obj) : error LNK2001: unresolved external symbol __imp__CertGetSubjectCertificateFromStore@12
    1>ChilkatDbgDll.lib(_ckMsCrypto.obj) : error LNK2019: unresolved external symbol __imp__CryptMsgControl@16 referenced in function "private: static bool __cdecl _ckMsCrypto::msDecryptInnerAlt(class DataBuffer const &,class DataBuffer &,class Certificate * *,class LogBase &)" (?msDecryptInnerAlt@_ckMsCrypto@@CA_NABVDataBuffer@@AAV2@PAPAVCertificate@@AAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(_ckMsCrypto.obj) : error LNK2019: unresolved external symbol __imp__CryptMsgGetParam@20 referenced in function "private: static bool __cdecl _ckMsCrypto::msDecryptInnerAlt(class DataBuffer const &,class DataBuffer &,class Certificate * *,class LogBase &)" (?msDecryptInnerAlt@_ckMsCrypto@@CA_NABVDataBuffer@@AAV2@PAPAVCertificate@@AAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(_ckMsCrypto.obj) : error LNK2019: unresolved external symbol __imp__CryptMsgClose@4 referenced in function "private: static bool __cdecl _ckMsCrypto::msDecryptInnerAlt(class DataBuffer const &,class DataBuffer &,class Certificate * *,class LogBase &)" (?msDecryptInnerAlt@_ckMsCrypto@@CA_NABVDataBuffer@@AAV2@PAPAVCertificate@@AAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(_ckMsCrypto.obj) : error LNK2019: unresolved external symbol __imp__CryptMsgUpdate@16 referenced in function "private: static bool __cdecl _ckMsCrypto::msDecryptInnerAlt(class DataBuffer const &,class DataBuffer &,class Certificate * *,class LogBase &)" (?msDecryptInnerAlt@_ckMsCrypto@@CA_NABVDataBuffer@@AAV2@PAPAVCertificate@@AAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(_ckMsCrypto.obj) : error LNK2019: unresolved external symbol __imp__CryptMsgOpenToDecode@24 referenced in function "private: static bool __cdecl _ckMsCrypto::msDecryptInnerAlt(class DataBuffer const &,class DataBuffer &,class Certificate * *,class LogBase &)" (?msDecryptInnerAlt@_ckMsCrypto@@CA_NABVDataBuffer@@AAV2@PAPAVCertificate@@AAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(_ckMsCrypto.obj) : error LNK2019: unresolved external symbol __imp__CryptDecryptMessage@24 referenced in function "private: static bool __cdecl _ckMsCrypto::msDecryptInner(class DataBuffer const &,class DataBuffer &,class Certificate * *,class LogBase &)" (?msDecryptInner@_ckMsCrypto@@CA_NABVDataBuffer@@AAV2@PAPAVCertificate@@AAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(_ckMsCrypto.obj) : error LNK2019: unresolved external symbol __imp__CryptSignMessage@28 referenced in function "public: static bool __cdecl _ckMsCrypto::msCryptoSignature(class CryptoSettings2 &,class Certificate &,bool,class SystemCerts &,unsigned char const *,unsigned int,int,class DataBuffer &,class LogBase &)" (?msCryptoSignature@_ckMsCrypto@@SA_NAAVCryptoSettings2@@AAVCertificate@@_NAAVSystemCerts@@PBEIHAAVDataBuffer@@AAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(_ckMsCrypto.obj) : error LNK2019: unresolved external symbol __imp__CryptEncodeObject@20 referenced in function "public: static bool __cdecl _ckMsCrypto::msCryptoSignature(class CryptoSettings2 &,class Certificate &,bool,class SystemCerts &,unsigned char const *,unsigned int,int,class DataBuffer &,class LogBase &)" (?msCryptoSignature@_ckMsCrypto@@SA_NAAVCryptoSettings2@@AAVCertificate@@_NAAVSystemCerts@@PBEIHAAVDataBuffer@@AAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(_ckMsCrypto.obj) : error LNK2019: unresolved external symbol __imp__CryptVerifyMessageSignature@28 referenced in function "private: static bool __cdecl _ckMsCrypto::msVerifySignatureInner(class CryptoSettings2 &,class DataBuffer const &,class DataBuffer &,class ExtPtrArray &,class LogBase &)" (?msVerifySignatureInner@_ckMsCrypto@@CA_NAAVCryptoSettings2@@ABVDataBuffer@@AAV3@AAVExtPtrArray@@AAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(_ckMsCrypto.obj) : error LNK2019: unresolved external symbol __imp__CryptVerifyDetachedMessageSignature@32 referenced in function "private: static bool __cdecl _ckMsCrypto::msVerifyDetachedSignatureInner(class CryptoSettings2 &,class DataBuffer const &,unsigned char const *,unsigned long,class ExtPtrArray &,class LogBase &)" (?msVerifyDetachedSignatureInner@_ckMsCrypto@@CA_NAAVCryptoSettings2@@ABVDataBuffer@@PBEKAAVExtPtrArray@@AAVLogBase@@@Z)
    1>ChilkatDbgDll.lib(_ckMsCrypto.obj) : error LNK2019: unresolved external symbol __imp__CryptEncryptMessage@28 referenced in function "private: static bool __cdecl _ckMsCrypto::msEncryptInner(class CryptoSettings2 &,unsigned char const *,unsigned long,class DataBuffer &,class ExtPtrArray &,class LogBase &)" (?msEncryptInner@_ckMsCrypto@@CA_NAAVCryptoSettings2@@PBEKAAVDataBuffer@@AAVExtPtrArray@@AAVLogBase@@@Z)
    1>c:\users\simboyd\documents\visual studio 2010\Projects\botnet\Debug\botnet.exe : fatal error LNK1120: 54 unresolved externals
    1>
    1>Build FAILED.
    1>
    1>Time Elapsed 00:00:01.33
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

知道如何解决这个问题吗?提前致谢。


如果有人想知道我是如何修复它的:将 Crypt32.lib 和 ws2_32.lib 添加到其他依赖项(链接器 > 输入)。

4

2 回答 2

10

您没有链接 Windows 套接字导入库。他们的图书馆不会为您提供服务。它也需要添加到您的链接器依赖项中。看起来他们的库实际上是一个静态库,它希望您的程序作为 MT DLL 链接。

添加ws2_32.lib到链接器设置配置中的库列表(您在其中添加了第 3 方库)。

于 2013-08-28T16:56:34.147 回答
1

看起来您需要链接到 Ws2_32.lib,它是导入库 winsock。

于 2013-08-28T16:57:16.587 回答