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;
    }
    return TRUE;
}

“error LNK2005: _DllMain@12 already defined in xxxLib.obj”의 15개의 댓글

  1. I do accept as true with all the ideas you’ve
    introduced to your post. They’re very convincing and
    will certainly work. Still, the posts are too short for starters.

    Could you please extend them a little from subsequent time?
    Thank you for the post.

  2. Its like you read my mind! You seem to understand so much approximately this, like you wrote the ebook in it
    or something. I think that you simply can do with a few percent to
    drive the message house a bit, but instead of that, that is magnificent blog.
    A great read. I’ll definitely be back.

  3. Hello there! This is kind of off topic but
    I need some help from an established blog. Is it difficult to set up your own blog?
    I’m not very techincal but I can figure things out pretty fast.

    I’m thinking about making my own but I’m not sure
    where to begin. Do you have any tips or suggestions?
    Thanks

  4. Undeniably believe that which you said. Your favorite reason seemed
    to be on the web the easiest thing to be aware
    of. I say to you, I certainly get annoyed while
    people consider worries that they plainly do not know about.
    You managed to hit the nail upon the top and defined out the whole thing without having side-effects , people could take a signal.
    Will probably be back to get more. Thanks

  5. I just want to mention I am just new to blogging and site-building and truly enjoyed your page. More than likely I’m planning to bookmark your website . You amazingly have excellent stories. Bless you for sharing with us your website.

  6. I simply want to mention I am just all new to blogging and really enjoyed you’re web-site. Most likely I’m going to bookmark your website . You surely come with perfect articles and reviews. Thank you for sharing your blog site.

  7. It is appropriate time to make some plans for the future and it
    is time to be happy. I have read this post and if I could I desire to suggest you some interesting things or tips.
    Perhaps you could write next articles referring to this article.
    I desire to read even more things about it!

  8. My partner and I stumbled over here different web page and thought I may as well check things out.
    I like what I see so now i’m following you. Look forward to going
    over your web page repeatedly.

댓글 남기기