Author Topic: Compiling...  (Read 5778 times)

Offline turdballs

  • Single posting newcomer
  • *
  • Posts: 3
Compiling...
« on: July 06, 2011, 02:31:26 am »
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...

Code
||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

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
}

Offline turdballs

  • Single posting newcomer
  • *
  • Posts: 3
Re: Compiling...
« Reply #1 on: July 06, 2011, 02:32:07 am »
could anyone tell me why i am getting all these errors?

Offline turdballs

  • Single posting newcomer
  • *
  • Posts: 3
Re: Compiling...
« Reply #2 on: July 06, 2011, 02:34:08 am »
here's some more error

Code
\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
 

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7592
    • My Best Post
Re: Compiling...
« Reply #3 on: July 06, 2011, 02:39:42 am »
Edit: step 1 decide what compiler you are using! Post it here.

I suggest turning an Full Compiler Logging!
http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

Then find a site that supports your Compiler; post your questions about how to use your compiler on a site other than this site.

Post your questions about how to use Code::Blocks on this site.
(I suggest reading ALL the FAQs and you might even read some of the CB Manual.)

Edit: I do NOT think that mixing Microsoft Directions and MinGW directions are likely to work.

« Last Edit: July 06, 2011, 02:43:45 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7592
    • My Best Post
Re: Compiling...
« Reply #4 on: July 06, 2011, 02:44:36 am »
could anyone tell me why i am getting all these errors?

You appeared to be passing Microsoft Compiler options to an MinGW GCC Compiler.

But, this site suggests a different cause and fix.
http://yeohhs.blogspot.com/2005/07/dev-c-and-mingw-warning-drectve.html

Tim S.
« Last Edit: July 06, 2011, 02:46:11 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org