Sep 11, 2011 at 11:50am UTC
Hi guys
I'm writting a dll under VS2010 but when i want to compile it i got
"Error 102 error LNK2005: _DllMain@12 already defined in b0fdll(test).obj"
so what i'm suppose to do with it ? i just googled it but i didn't come up with any good result ......
source code :
#include "stdafx.h"
//#include <Windows.h>
#include <stdio.h>
BOOL APIENTRY DllMain
(
HINSTANCE hinstDLL, //handle to DLL module
DWORD fdwReason, // reason for calling the function
LPVOID lpReserved // Reserved
)
{
switch(fdwReason)
{
case DLL_PROCESS_ATTACH:
printf("Process pid=(%d) loading DLL\n",GetCurrentProcessId());
break;
}
}
Regards ;)
Sep 11, 2011 at 11:54am UTC
Well, it says you already defined DllMain somewhere else.
Last edited on Sep 11, 2011 at 11:55am UTC
Sep 11, 2011 at 12:36pm UTC
I know , but i didn't do this .... so does anyone know how to solve it ?
Sep 11, 2011 at 5:41pm UTC
I assume you have a source file called b0fdll(test).cpp or similar? What are their contents? More specifically: Does this file contain a definition of DllMain()? If yes, what happens when you remove it?