First, call the static library file:
Two different ways:
1 Using the VS tool
1), Tools "Options" project and Solution "VC + + directory to set the directory containing files and library files
2) The CPP contains the header files, and the namespaces to be used, and then the related things can be called
2, not by the way of setting directory:
1) CPP contains the header file
2) CPP added #pragma comment (lib, ". \\debug\\testlib.lib ")
Two: Call the dynamic library file
Include header file # include <Windows.h>
[Code=cpp]
typedef int (*DLLFUNC) ();
int main (int argc, _tchar* argv[])
{
Inc ();
DllFunc M_fun;
HINSTANCE hDLL;
hDLL = (hinstance) LoadLibrary (_t (". \\debug\\testdll.dll "));
if (!hdll)
{
FreeLibrary (hDLL);
return 0;
}
M_fun = (dllfunc) GetProcAddress (hDLL, "Inc");
if (NULL = = M_fun)
{
FreeLibrary (hDLL);
return 0;
}
Add ();
M_fun ();
FreeLibrary (hDLL);
return 0;
}
[/code]
Talking about the Call of C + + dynamic library and Static library