K8062D.dll and C program ?

It seems that you are using 64-bit compiler to generate 64-bit code.
The DLL is a 32-bit file and it is not compatible with 64-bit compiler and maybe also with the dlltool you used to build the lib file.
In this thread there is some info and a link to download the 64-bit DLL version: