Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

_DllMain@12 already defined

Tags:

dll

mfc

I try to build subproject ExplorerPlugin from mDNSResponder-107.6.tar.gz archive but receive next link error:

uafxcwd.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined

how to solve it?

like image 953
vinnitu Avatar asked Dec 27 '10 14:12

vinnitu


2 Answers

I had exactly the same problem and this fixed it: https://stackoverflow.com/a/19930430/625227

Enter this code in the .cpp file where your DLLMain function is

extern "C" { int _afxForceUSRDLL; } 
like image 120
Grant Avatar answered Sep 17 '22 12:09

Grant


Looks like you are using MFC. It already has a DllMain entrypoint, required to initialize MFC properly. Check this KB article for recommended workarounds. Hard to otherwise provide a better answer, you didn't provide a link and it looks to me like this is Apple code, very un-mfc-ish.

like image 23
Hans Passant Avatar answered Sep 19 '22 12:09

Hans Passant