Compile error on a library from github (subhook)

I am trying to compile this simple hooking library: https://github.com/Zeex/subhook

and I am getting these errors:

1>subhook.obj : warning LNK4006: subhook_new already defined in subhook_x86.obj; second definition ignored
1>subhook.obj : warning LNK4006: subhook_free already defined in subhook_x86.obj; second definition ignored
1>subhook.obj : warning LNK4006: subhook_install already defined in subhook_x86.obj; second definition ignored
1>subhook.obj : warning LNK4006: subhook_remove already defined in subhook_x86.obj; second definition ignored
1>subhook.obj : warning LNK4006: subhook_read_dst already defined in subhook_x86.obj; second definition ignored
1>subhook.obj : warning LNK4006: subhook_disasm already defined in subhook_x86.obj; second definition ignored
1>subhook.obj : warning LNK4006: subhook_unprotect already defined in subhook_windows.obj; second definition ignored
1>subhook.obj : warning LNK4006: subhook_alloc_code already defined in subhook_windows.obj; second definition ignored
1>subhook.obj : warning LNK4006: subhook_free_code already defined in subhook_windows.obj; second definition ignored

Has anyone used this lib before?
How do you build it ? What compiler / IDE and OS do you use ?
You get that kind of mess when people take short-cuts and include one .c file in another.

1
2
3
4
5
6
7
8
9
10
11
12
13
#ifndef SUBHOOK_SEPARATE_SOURCE_FILES

#if defined SUBHOOK_WINDOWS
  #include "subhook_windows.c"
#elif defined SUBHOOK_UNIX
  #include "subhook_unix.c"
#endif

#if defined SUBHOOK_X86 || defined SUBHOOK_X86_64
  #include "subhook_x86.c"
#endif

#endif 

Maybe you need to define (or not) SUBHOOK_SEPARATE_SOURCE_FILES
Looks like all I had to do is to only press "Include In project" on subhook.c after copying the source files into my project's folder.

Thanks for the answers above!
Topic archived. No new replies allowed.