Hello
I need help with this.
I build a DLL with MS Visual c++ 6. The library exports a function in this way: _declspec(dllexport) _stdcall int f(int a,char **b);
Let's call the DLL A.DLL.
The DLL compiles correctly, and with the DUMPBIN utility I see it is exporting function f.
Now, I'm programming an example aplication that imports this function and calls it. I create a project, and add the
A.LIB library to Project->settings->Link->Libraries, and the directory where it is to Proj->Settings->Links->Input->Additional Library Path.
The program is as simple as this:
_declspec(dllimport) int _stdcall f(int argc,char**argv);
int main(int argc, char* argv[])
{
f(argc,argv);
return 0;
}
I keep getting this error:
error LNK2001: unresolved external symbol "__declspec(dllimport) int __stdcall f(int,char * *)" (__imp_?f@@YGHHPAPAD@Z)
I've tried to change the calling convention to _cdecl, to create a a.def file to export the function with other name, to copy the libraries to the new project directory, to add the a.dll instead of a.lib to the import libraries(then I get a: "fatal error LNK1136: invalid or corrupt file"
, to add the lib and dll files to the project directly(in Add Files to Project), and different combinations of this changes. Also tried creating a new project from scratch, still getting the same problem.
I need help with this.
I build a DLL with MS Visual c++ 6. The library exports a function in this way: _declspec(dllexport) _stdcall int f(int a,char **b);
Let's call the DLL A.DLL.
The DLL compiles correctly, and with the DUMPBIN utility I see it is exporting function f.
Now, I'm programming an example aplication that imports this function and calls it. I create a project, and add the
A.LIB library to Project->settings->Link->Libraries, and the directory where it is to Proj->Settings->Links->Input->Additional Library Path.
The program is as simple as this:
_declspec(dllimport) int _stdcall f(int argc,char**argv);
int main(int argc, char* argv[])
{
f(argc,argv);
return 0;
}
I keep getting this error:
error LNK2001: unresolved external symbol "__declspec(dllimport) int __stdcall f(int,char * *)" (__imp_?f@@YGHHPAPAD@Z)
I've tried to change the calling convention to _cdecl, to create a a.def file to export the function with other name, to copy the libraries to the new project directory, to add the a.dll instead of a.lib to the import libraries(then I get a: "fatal error LNK1136: invalid or corrupt file"