In our project property pages, linker section, General tab, we add in the Additional Library Directories the folder where our DLL is. Again in the Linker section, but Input tab, we change the Additional Dependency adding the LIB file relative to our DLL.
Now we can use the DLL in our code:
#include <iostream>
#include "..\xDll\xDll.h"
int _tmain()
{
std::cout << "A banal window app w/DLL" << std::endl;
f();
system("pause");
return 0;
}
Including the xDll.h header file we have available the declaration for the function, named f(), defined in the DLL, so we can use it in the code.
No comments:
Post a Comment