Archived Forum Post

Index of archived forum posts

Question:

unresolved external symbol CkCrypt2

Dec 08 '16 at 07:53

Hello,

Trying to run the encription c++ example for hash. https://www.example-code.com/cpp/crypt2_md5_hash_file.asp

I created a project in MSVC 12 and added the include and lib for the crypt download from your site. I also add libs to link with to to the project crypt32.lib and advapi32.lib

Where did I go wrong ...?

I get the following errors. Assume I am missing an library to link with ...

Thanks!

The errors Error 9 error LNK1120: 8 unresolved externals C:dvjspasswordcppexample_passwordDebugexample_password.exe example_password Error 3 error LNK2019: unresolved external symbol "public: thiscall CkCrypt2::CkCrypt2(void)" (??0CkCrypt2@@QAE@XZ) referenced in function "void cdecl sample(void)" (?sample@@YAXXZ) C:dvjspasswordcppexample_passwordexample_passwordexample_password.obj example_password Error 8 error LNK2019: unresolved external symbol "public: bool thiscall CkCrypt2::UnlockComponent(char const *)" (?UnlockComponent@CkCrypt2@@QAE_NPBD@Z) referenced in function "void cdecl sample(void)" (?sample@@YAXXZ) C:dvjspasswordcppexample_passwordexample_passwordexample_password.obj example_password Error 1 error LNK2019: unresolved external symbol "public: bool thiscall CkMultiByteBase::get_LastMethodSuccess(void)" (?get_LastMethodSuccess@CkMultiByteBase@@QAE_NXZ) referenced in function "void cdecl sample(void)" (?sample@@YAXXZ) C:dvjspasswordcppexample_passwordexample_passwordexample_password.obj example_password Error 7 error LNK2019: unresolved external symbol "public: char const * thiscall CkCrypt2::hashFileENC(char const *)" (?hashFileENC@CkCrypt2@@QAEPBDPBD@Z) referenced in function "void cdecl sample(void)" (?sample@@YAXXZ) C:dvjspasswordcppexample_passwordexample_passwordexample_password.obj example_password Error 2 error LNK2019: unresolved external symbol "public: char const * thiscall CkMultiByteBase::lastErrorText(void)" (?lastErrorText@CkMultiByteBase@@QAEPBDXZ) referenced in function "void cdecl sample(void)" (?sample@@YAXXZ) C:dvjspasswordcppexample_passwordexample_passwordexample_password.obj example_password Error 4 error LNK2019: unresolved external symbol "public: virtual thiscall CkCrypt2::~CkCrypt2(void)" (??1CkCrypt2@@UAE@XZ) referenced in function "void cdecl sample(void)" (?sample@@YAXXZ) C:dvjspasswordcppexample_passwordexample_passwordexample_password.obj example_password Error 5 error LNK2019: unresolved external symbol "public: void thiscall CkCrypt2::put_EncodingMode(char const *)" (?put_EncodingMode@CkCrypt2@@QAEXPBD@Z) referenced in function "void cdecl sample(void)" (?sample@@YAXXZ) C:dvjspasswordcppexample_passwordexample_passwordexample_password.obj example_password Error 6 error LNK2019: unresolved external symbol "public: void thiscall CkCrypt2::put_HashAlgorithm(char const *)" (?put_HashAlgorithm@CkCrypt2@@QAEXPBD@Z) referenced in function "void cdecl sample(void)" (?sample@@YAXXZ) C:dvjspasswordcppexample_passwordexample_passwordexample_password.obj example_password


Answer

Somehow you're not actually linking with the Chilkat .lib

It's just a matter of updating your MSVC project settings to link with the matching .lib contained in the download. (You choose the .lib based on the runtime, i.e.. Release vs. Debug, Static vs. "DLL")