Q
quortex
Hi all,
I have a class which contains a method called GetMessage(). When I
compile and unit test it all is well.
However in the application I want to use it in there appears to be a
conflict with Windows.h. I receive the following error:
Error 1 error LNK2001: unresolved external symbol "public: class
Messaging::Native::IMessage * __thiscall
Messaging::Native::MessageEvent::GetMessageW(void)"
(?GetMessageW@MessageEvent@Native@Messaging@@QAEPAVIMessage@234@XZ) Program.obj
As far as I can tell this is due to the following definition in
Windows.h which is causing the linker to convert my GetMessage() method
call to GetMessageW(). The line which causes this is as such:
_message = notification->GetMessage(); (notification is a
MessageEvent*)
And I think the linker is trying to do ->GetMessageW(); because of:
#define GetMessage GetMessageW
Which is included in one of the includes from Windows.h. I am using
Unicode so I cannot turn unicode off but then I guess it would still
have problems as it would then translate to GetMessageA();
I do not want to have to rename my method because of this. How can I
get remove this conflict? I would of thought that the definition would
only affect the global namespace but alas I must be wrong.
Kind Regards,
Mark
I have a class which contains a method called GetMessage(). When I
compile and unit test it all is well.
However in the application I want to use it in there appears to be a
conflict with Windows.h. I receive the following error:
Error 1 error LNK2001: unresolved external symbol "public: class
Messaging::Native::IMessage * __thiscall
Messaging::Native::MessageEvent::GetMessageW(void)"
(?GetMessageW@MessageEvent@Native@Messaging@@QAEPAVIMessage@234@XZ) Program.obj
As far as I can tell this is due to the following definition in
Windows.h which is causing the linker to convert my GetMessage() method
call to GetMessageW(). The line which causes this is as such:
_message = notification->GetMessage(); (notification is a
MessageEvent*)
And I think the linker is trying to do ->GetMessageW(); because of:
#define GetMessage GetMessageW
Which is included in one of the includes from Windows.h. I am using
Unicode so I cannot turn unicode off but then I guess it would still
have problems as it would then translate to GetMessageA();
I do not want to have to rename my method because of this. How can I
get remove this conflict? I would of thought that the definition would
only affect the global namespace but alas I must be wrong.
Kind Regards,
Mark