Unresolved external symbolic link error
I have a project where I need mouse hooks to use, so I added the MOUSE HOOK DLL project to my solution. When restoring, I get the following errors:
Error 3 error LNK2005: "struct HHOOK__ * MyHook" (?MyHook@@3PAUHHOOK__@@A) already defined in projdialog.obj projdialogDlg.obj
Error 4 error LNK2005: "struct HINSTANCE__ * MyInstance" (?MyInstance@@3PAUHINSTANCE__@@A) already defined in projdialog.obj projdialogDlg.obj
Error 5 error LNK2019: unresolved external symbol "void __cdecl Hook(void)" (?Hook@@YAXXZ) referenced in function "public: void __thiscall CProjdialogDlg::OnLButtonDown(unsigned int,class CPoint)" (?OnLButtonDown@CProjdialogDlg@@QAEXIVCPoint@@@Z) projdialogDlg.obj
Error 6 error LNK2019: unresolved external symbol "void __cdecl Unhook(void)" (?Unhook@@YAXXZ) referenced in function "public: void __thiscall CProjdialogDlg::OnLButtonUp(unsigned int,class CPoint)" (?OnLButtonUp@CProjdialogDlg@@QAEXIVCPoint@@@Z) projdialogDlg.obj
Error 7 fatal error LNK1120: 2 unresolved externals .\Debug/projdialog.exe
+1
user103981
a source
to share
1 answer
1) "struct HHOOK__ * MyHook" (? MyHook @@ 3PAUHHOOK __ @@ A) already defined in projdialog.obj
Usually this error occurs if this feature is enabled twice by re-including header files, U can watch for this (or) use this Linker FORCE option: MULTIPLE
2) Unresolved external symbol error. The compiler was unable to find definitions for the Hook and Unhook functions.
if defined in another file, include that header file. and add this to the top of the file where you call the function. extern void __cdecl Unhook (void);
if it is API and dll are implicitly linked. Add DLL DLL to additional dependencies.
+1
a source to share