1

I have downloaded EasyHook 2.7 source and I try to compile it in my Visual Studio 2012 environment.

After solving a lot of warnings, I have found other warnings that I cannot solve, and these are:

1>error.obj : error LNK2019: unresolved external symbol _CoTaskMemAlloc@4 referenced in function _RtlGetLastErrorStringCopy@0
1>error.obj : error LNK2019: unresolved external symbol _CopyMemory@12 referenced in function _RtlGetLastErrorStringCopy@0
1>reloc.obj : error LNK2019: unresolved external symbol _ud_init@4 referenced in function _LhDisassembleInstruction@20
1>reloc.obj : error LNK2019: unresolved external symbol _ud_set_mode@8 referenced in function _LhDisassembleInstruction@20
1>reloc.obj : error LNK2019: unresolved external symbol _ud_set_input_buffer@12 referenced in function _LhDisassembleInstruction@20
1>reloc.obj : error LNK2019: unresolved external symbol _ud_set_syntax@8 referenced in function _LhDisassembleInstruction@20
1>reloc.obj : error LNK2019: unresolved external symbol _ud_disassemble@4 referenced in function _LhDisassembleInstruction@20
1>reloc.obj : error LNK2019: unresolved external symbol _ud_translate_intel@4 referenced in function _LhDisassembleInstruction@20
1>reloc.obj : error LNK2019: unresolved external symbol _ud_set_asm_buffer@12 referenced in function _LhDisassembleInstruction@20
1>C:\Users\Jaime Stuardo\Downloads\EasyHook-2.7.5159.0-Source\\Debug\x86\EasyHook32Drv.sys : fatal error LNK1120: 9 unresolved externals

What lib files I need to add so that the linker will not fail? notice that the first 2 functions belong to Windows API, so it is very curious it does not link.

Regards Jaime

jstuardo
  • 3,901
  • 14
  • 61
  • 136

1 Answers1

0

For the Windows functions, just look them up on MSDN. CoTaskMemAlloc says you need to link OLE32.LIB. CopyMemory says KERNEL32.LIB. The functions beginning with ud come from a library which Easyhook depends on: "EasyHook makes use of the udis86 library by Vivek.

David Ching
  • 1,903
  • 17
  • 21
  • For the project, these are the inherited libraries that are being linked: kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib.... and these are additional libraries: ntoskrnl.lib hal.lib ntstrsafe.lib – jstuardo Mar 26 '15 at 22:05
  • Are you sure? `CoTaskMemAlloc` is unresolved, so it seems OLE32.LIB is not being linked. – David Ching Mar 28 '15 at 16:49
  • Of course.. please see this screnshot at http://www.desytec.com/build-error.png.... I use to develop C++ software in either Linux and Windows and I have never faced this problem.... since this code is more complex and not developed by me, I don't know what may cause this, Maybe other library is entering in conflict. – jstuardo Apr 02 '15 at 23:12