I have produced a dll with MASM and used a def file to export 1 function.....
I can use the .lib to statically link to this dll with another MASM program.....No problem
But I tried to use this dll with VC++ and I cant get the static link.....It complains that the symbol is unresolved......
I tried to declare it "extern "C"" but still to no avail........
Is there any easy way to fix this? Or am I stuck with dynamic linking?
Thanks in advance
I can use the .lib to statically link to this dll with another MASM program.....No problem
But I tried to use this dll with VC++ and I cant get the static link.....It complains that the symbol is unresolved......
I tried to declare it "extern "C"" but still to no avail........
Is there any easy way to fix this? Or am I stuck with dynamic linking?
Thanks in advance
What symbol is the compiler looking for (it's exact name)?
You should use extern "C" at least unless you want to figure out the ugly C++ name decorations.. However did you use the right calling convention? The default in masm is STDCALL while C uses cdecl. Try adding __stdcall to your C function header.
Thomas
You should use extern "C" at least unless you want to figure out the ugly C++ name decorations.. However did you use the right calling convention? The default in masm is STDCALL while C uses cdecl. Try adding __stdcall to your C function header.
Thomas
Ha...excellent...the __stdcall worked.....
I didnt consider that!
Thank you very much
I didnt consider that!
Thank you very much
Just to be anal: you don't link statically to a DLL. To link statically
means to include code from a .lib file in your executable. When you
include an import library for a DLL, you link implicitly - not statically :).
LoadLibrary + GetProcAddress is explicit linking/loading of a DLL.
means to include code from a .lib file in your executable. When you
include an import library for a DLL, you link implicitly - not statically :).
LoadLibrary + GetProcAddress is explicit linking/loading of a DLL.