DLL file compilation error _dllmain@12 already defined in Xxx.obj

Source: Internet
Author: User

Occurs when compiling an MFC DLL program

Error2 error lnk1169:one or more multiply defined symbols founde:\c++\hooktest\ Copyfiledetour\cfdetour\debug\1t.dll1 1t 1
Error 1 error LNK2005: [email protected] already defined in 1t.obje:\c++\hooktest\ Copyfiledetour\cfdetour\1t\mfcs100ud.lib (dllmodul.obj)1t

1t DLL project name for the test


Error Resolution Method:

Location: Project->propertie->c/c++->preprocessor->preprocessor Definitions

The original sentence "win32;_debug;_windows;_usrdll;datalog_exports;% ( preprocessordefinitions) "Remove the inside _usrdll to resolve the problem. It is very likely that this problem is caused by adding # include <afx.h>.


The following error may occur after you do not affect the program's compilation Run

3IntelliSense: #error directive:please use THE/MD switch for _afxdll buildsd:\vs2010c++\vc\atlmfc\ Include\afxver_.h Bayi 3

You can change it with the following settings

Project->property->configuration Properties->c/c++->code generation->runtime Library, at Runtime Under Library, select the multithreaded DLL or the debug multithreaded DLL.

DLL file compilation error [email protected] Already defined in Xxx.obj

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.