i am using ms detours 1.5 library. i have included detours.h in the project and setup my linker and compiler directories to the folder where detours.lib and detours.h are. I also added detours.lib to the linker but i get these errors no matter what when i compile...
||Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"detours" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"detours" ' unrecognized|
C:\Users\Alford\Documents\c++\detour\detours.lib(detours.obj)||In function `DetourFunction@8':|
8]+0x9)||undefined reference to `??2@YAPAXI@Z'|
c:\code\detours\sr|10|undefined reference to `??3@YAXPAX@Z'|
C:\Users\Alford\Documents\c++\detour\detours.lib(detours.obj)||In function `DetourEnumerateModules@4':|
4]+0x11)||undefined reference to `_except_list'|
4]+0x19)||undefined reference to `_except_list'|
c:\code\detours\sr|43|undefined reference to `_except_list'|
C:\Users\Alford\Documents\c++\detour\detours.lib(detours.obj)||In function `DetourGetEntryPoint@4':|
4]+0x11)||undefined reference to `_except_list'|
4]+0x19)||undefined reference to `_except_list'|
C:\Users\Alford\Documents\c++\detour\detours.lib(detours.obj):c:\code\detours\sr|29|more undefined references to `_except_list' follow|
||=== Build finished: 8 errors, 2 warnings ===|
here is my code
#include "main.h"
#include "detours.h"
void DLL_EXPORT SomeFunction(const LPCSTR sometext)
{
MessageBoxA(0, sometext, "DLL Message", MB_OK | MB_ICONINFORMATION);
}
char __stdcall *getPckt()
{
char *hello = "hithere";
return hello;
}
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
if(fdwReason == DLL_PROCESS_ATTACH){
DetourFunction((PBYTE)0x7686C4C8, (PBYTE)getPckt);
}
else if (fdwReason == DLL_PROCESS_DETACH) {
MessageBox(NULL, "ERROR", "wtf?", MB_ICONERROR);
}
return TRUE; // succesful
}
here's some more error
\Documents\c++\detour\detours.lib(detours.obj):c:\code\detours\sr:29: more undefined references to `_except_list' follow
collect2: ld returned 1 exit status
Creating library file: bin\Debug\libdetour.dll.a
Process terminated with status 1 (0 minutes, 0 seconds)
8 errors, 2 warnings