Note that there are some explanatory texts on larger screens.

plurals
  1. POC++\CLI LNK Error 2019 & 2028 with Included .h and .lib (Linker finds those Files) [Wrapper]
    text
    copied!<p>I have a problem with this code, writing a wrapper function from an existing .lib (CryptoLib.lib):</p> <p>mycode.ccp</p> <pre><code>#include "stdafx.h" #pragma managed(push, off) #include "CryptoLib.h" #pragma comment (lib, "CryptoLib.lib") #pragma managed(pop) using namespace System;//This is a C++-CLI project. __declspec(dllexport) void Encrypt(unsigned char *Data, unsigned char *RandomNr) { CryptoLib_Encrypt(Data, RandomNr); } </code></pre> <p>cryptolib.h</p> <pre><code>#ifndef _CRYPTOLIB_H_ #define _CRYPTOLIB_H_ #define PUBLIC //This procedure is written in c++ code extern void CryptoLib_Encrypt(unsigned char *Data, unsigned char *RandomNr); #endif /* _CRYPTOLIB_H_ */ </code></pre> <p>I have linked the cryptolib.h and the cryptolib, but i get still the "unresolved token Cryptolib_Encrypt" and the "unresolved external symbol Cryptolib_Encrypt" Errors.</p> <p>Can anyone tell me why?</p> <p>Thanks for helping</p> <p>Exact Error-messages:</p> <pre><code>error LNK2028: unresolved token (0A000006) "void __cdecl CryptoLib_Encrypt(unsigned char *,unsigned char *)" (?CryptoLib_Encrypt@@$$FYAXPAE0@Z) referenced in function "void __cdecl Encrypt(unsigned char *,unsigned char *)" (?Encrypt@@$$FYAXPAE0@Z) error LNK2019: unresolved external symbol "void __cdecl CryptoLib_Encrypt(unsigned char *,unsigned char *)" (?CryptoLib_Encrypt@@$$FYAXPAE0@Z) referenced in function "void __cdecl Encrypt(unsigned char *,unsigned char *)" (?Encrypt@@$$FYAXPAE0@Z) error LNK1120: 2 unresolved externals </code></pre> <p>The <code>Dumpbin.exe /exports</code> comand line returns just <img src="https://i.stack.imgur.com/cOxIH.png" alt="Dumpbin.exe /exports"></p> <p>But i still added the C/C++ Additional Include Directory in Configuration Properties/"C/C++"/General and the Additional Dependencies (<code>Cryptolib.lib</code>) in Configuation Properties/Linker/Input</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload