I am trying to access the .lib file using visual studio 2012. below are the steps I followed
Created a class library, and included header(.hpp) and .lib file
Header file :-
extern "C" unsigned int GetKey();
Class library
public: static unsigned int GetKey1() { return GetKey(); }
Built the application and it is successful, lets call it as classlibrary
- Created a win 32 console application and added the above dll as reference, tried to access the method in dll, built got succeed, but when i tried to run it , it showing file not found exception in classlibrary.dll or its dependencies like below.
Source file
using namespace ManagedMathFuncsLib;
int main()
{
Class1 cs;
cout<<"default value of variable from dll : "<< cs.GetKey1()<<endl;
return 0;
}
Error
An unhandled exception of type 'System.IO.FileNotFoundException' occurred in Unknown Module.
Additional information: Could not load file or assembly 'XXXXXXX.dll' or one of its dependencies. The specified module could not be found.
If there is a handler for this exception, the program may be safely continued.
**Do i need the dll related to .lib file? Please help.**