error LNK2005: _DllMain@12 already defined in xxxLib.obj

DLL 프로젝트를 수행할 때 error LNK2005: _DllMain@12 already defined in xxxLib.obj 와 같이 에러가 발생하면 DLLMIAN앞에다  extern “C” { int _afxForceUSRDLL; } 와 같이 기록해주면 된다. extern “C” { int _afxForceUSRDLL; } BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: case DLL_PROCESS_DETACH: break;