简体   繁体   中英

how to call unmanaged dll from managed c++

I am calling an unmanaged DLL from managed C++. The DLL has more than one native dependency. I am trying to compile this through Visual Studio.

I have done the following:

  1. Added the directory that contains the DLLs and the .lib to Properties -> VC++ Directories -> Library directories

  2. Added the unmanaged .lib to Properties -> Input -> Additional Dependencies

However, I get linking errors for the functions that I refer to. I haven't added any DLL or lib to the project except for the header file of the library.

UPDATE: So it is able to find the .lib because if I give a bogus .lib in additional dependencies I get compilation error of the .lib not found. The error that I have is "unresolved token .... " .

I suggest you have a good read of this . Calling DLLs from C# is straightforward, because .NET supports it and managed C++ is just another .NET implementation, and should also be straightforward.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM