0

I am having trouble building the solution for detours. I am getting errors like:

  1. error LNK2019: unresolved external symbol _DetourCopyInstruction@20 referenced in function _DetourAttachEx@20 and

  2. error LNK1120: 1 unresolved externals.

What should I do now?

SLOVAK81
  • 43
  • 5

2 Answers2

2

You are missing the library "detours.lib" in your linking phase. If you add it, this should solve the problem.

In my Visual Studio, go to your project properties and under "Linker" go to Input and write "detours.lib". Make sure to either have "detours.lib" in your VS library folder or add a path to the library explicitly in the project properties under "Linker", "Additional Library Directories". That's all you need to do to fix this problem.

halsten
  • 122
  • 11
0

I doubt if you're still looking for an answer, but in case you are and for anyone else looking for a solution to this problem. This might help (though you really should show the code giving you the problem to help people help you.

You might have your main method embedded in a class, but do not have a main method that is not embedded. If it's in a class, the linker won't be able to find it.

int main()
{
YourClassName::main(); // class name with a main() method in it.
return 0;
}

Just add this, or something like it in the same file, below the class that has your main method and you should be good.

deadEddie
  • 242
  • 2
  • 8
  • 20