There are many questions which are similar to this, but I have almost done everything to resolve the issue, but nothing seems to work
I have created a small simple Dll.
declarations:
void func_A()
void func_B()
There is some other stuff also, I have given it a C++ filename, but its basically C program only
I have written .def file
LIBRARY "myLib.dll"
EXPORTS
func_A @1
func_B @2
Dll is created successfully.
I have made sure that .def file is there in properties->linker->input->module definition file
I have also checked for exported functions using Dumpbin
, all is good so far
Now In client code, I have written header like
extern "C" __declspec(dllimport) void func_A();
extern "C" __declspec(dllimport) void func_B();
which indeed satisfies the compiler,
Have copied .lib and .dll from DLL project to client project, Have kept .lib where .obj files are generated and have kept .dll where .exe will be generated.
But I get LNK2019: unresolved external symbol
for dll function calls
I think I am sure that .lib is found by the linker, because if I remove Addition Library Dependencies
I get .lib file not found error
from linker.
As nothing was working, I have also tries using __declspec(dllexport)
while creating a .dll, but to no avail