CryptAcquireContext - Unresolved External

I am linking with a third party library (Poco C ++) and am getting the following unresolved symbolic errors from the linker. It seems that "CryptAcquireContextW", "CryptReleaseContext" and "CryptGenRandom" cannot be found.

According to Microsoft's information here , these functions are linked using "Advapi32.lib". I added this to my linker attachments, but the symbols remain unresolved.

1>PocoFoundationCLR.lib(RandomStream.obj) : error LNK2019: unresolved external symbol __imp__CryptAcquireContextW@20 referenced in function "public: virtual int __thiscall Poco::RandomBuf::readFromDevice(char *,__int64)" (?readFromDevice@RandomBuf@Poco@@UAEHPAD_J@Z)

1>PocoFoundationCLR.lib(RandomStream.obj) : error LNK2019: unresolved external symbol __imp__CryptReleaseContext@8 referenced in function "public: virtual int __thiscall Poco::RandomBuf::readFromDevice(char *,__int64)" (?readFromDevice@RandomBuf@Poco@@UAEHPAD_J@Z)

1>PocoFoundationCLR.lib(RandomStream.obj) : error LNK2019: unresolved external symbol __imp__CryptGenRandom@12 referenced in function "public: virtual int __thiscall Poco::RandomBuf::readFromDevice(char *,__int64)" (?readFromDevice@RandomBuf@Poco@@UAEHPAD_J@Z)

      

I have verified that Advapi32.lib is in the search path and Advapi32.dll is in the Windows directory, so I have no idea how this error continues.

Ideas, anyone?

Thank!

+3


source to share


1 answer


While I can't readily explain why it worked, here's what.

As a result of the failed project, "Advapi32.lib" was listed in the "Inherited" section of the linker inputs, but apparently it was not actually linked.



I added "Advapi32.lib" to the Additional Libraries section and somehow it made it pick and link correctly.

I'm going to write this down as just a difference in how VS 2013 was installed on two PCs, but it's still a curious oddity.

+2


source







All Articles