S
Sai Kit Tong
I try to utilize an old native code class library for my managed C++
application, and experience a weird problem. I used IJW approach and
included the header file for my native class definition. I compiled my
application. The compiling phase was successful but I had a linker problem
on just one of the many member functions. The member function has following
signature:
class CMyNativeClass
{
public:
....
....
int SetPort(int);
int SetMinLength(int);
....
}
The linker issues the following error message in my managed code:
error LNK2019: unresolved external symbol "__declspec(dllimport) public: int
__thiscall CMyNativeClass::SetPortA(int)"
(__imp_?SetPortA@CMyNativeClass@@QAEHH@Z) referenced in function
_myFunction.
No linker error for other member function call. I perform a dumbin on my
..lib file (included in the linker) and my .dll file. Both have the member
function name:
"?SetPort@CMyNativeClass@@QAEHH@Z"
How did the linker get confused and use the member function name with "A"
attached.
Is this a bug?
application, and experience a weird problem. I used IJW approach and
included the header file for my native class definition. I compiled my
application. The compiling phase was successful but I had a linker problem
on just one of the many member functions. The member function has following
signature:
class CMyNativeClass
{
public:
....
....
int SetPort(int);
int SetMinLength(int);
....
}
The linker issues the following error message in my managed code:
error LNK2019: unresolved external symbol "__declspec(dllimport) public: int
__thiscall CMyNativeClass::SetPortA(int)"
(__imp_?SetPortA@CMyNativeClass@@QAEHH@Z) referenced in function
_myFunction.
No linker error for other member function call. I perform a dumbin on my
..lib file (included in the linker) and my .dll file. Both have the member
function name:
"?SetPort@CMyNativeClass@@QAEHH@Z"
How did the linker get confused and use the member function name with "A"
attached.
Is this a bug?