[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 192
  • Last Modified:

DLL project fails

Hello experts,

Today I have tried to make a dll project. I am sure that before closing up the MFC windows, no linking errors. With nothing changed, I open the workspace again and I have got these linking errors:

Linking...
mfcs42d.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in MSVCRTD.lib(dllmain.obj)
mfcs42d.lib(dllmodul.obj) : warning LNK4006: _DllMain@12 already defined in MSVCRTD.lib(dllmain.obj); second definition ignored
   Creating library Debug/xxx.lib and object Debug/xxx.exp
Debug/xxx.dll : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.

I don't know what wrong I did. Have you encountered such questions before? Any suggestion?
0
pigpig
Asked:
pigpig
1 Solution
 
Vinayak KumbarSr Program ManagerCommented:
Hi,

R the errors coming after rebuild all?
Remove the debug/Release directory and build once again. r the errors coming now also?

VinExpert
0
 
inprasCommented:
Hi
Restart the system if U canot come over the problems by using methods of VinExpert.
0
 
pigpigAuthor Commented:
also linking errors...
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
pigpigAuthor Commented:
also linking errors...
0
 
MichaelSCommented:
If you use MFC you don't have to use DllMain function.
0
 
Vinayak KumbarSr Program ManagerCommented:
Hi,

Try generating same dll in a new workspace. R errors coming?. If not then check project settings.


VinExpert
0
 
mikeblasCommented:
> If you use MFC you don't have to use DllMain function.


If you carefully examine the errors pigpig posted, you'll see that it's not him who's defining DllMain. It's MFC (for one definition) and the C Runtimes (for the other definition).

..B ekiM
0
 
chensuCommented:
Coincidentally, I just solved a similar problem yesterday.

PRB: LNK2005 Errors When Link C Run-Time Libs Before MFC Libs
http://support.microsoft.com/support/kb/articles/Q148/6/52.asp
0
 
pigpigAuthor Commented:
Thanks.
Really helpfull answer!
This MFC trick is very tricky.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now