Re: Copy configuration link error



"Drew" <drew.nospam.myers@xxxxxxxx> wrote in message
news:eW2niqkaGHA.460@xxxxxxxxxxxxxxxxxxxx
I created a new configuration (VS6) and copied settings from an
existing (working)
configuration. Now, the new configuration has a link error:

mfcs42.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined
in msvcrt.lib(dllmain.obj)

Make sure MFC setting agrees with CRT setting. See

Project | Settings | General | Microsoft Foundation Classes
Project | Settings | C/C++ | Code Generation | Use run-time library

If you choose "Use MFC in a Static Library" for the first setting, you
should also use something not containing DLL (e.g. Multithreaded or
Debug Multithreaded) for the second setting. And if you choose "Use MFC
in a Shared DLL", you should choose DLL version of CRT.

Your current configuration links to MFC statically and to CRT
dynamically. This won't work.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925


.



Relevant Pages

  • Re: VirtualAlloc()
    ... So, for debug builds `new' is replaced with `DEBUG_NEW', ... you can detect memory ... The MFC facilities are built upon the CRT, ...
    (microsoft.public.vc.language)
  • Re: Link Error, LNK2005
    ... Try using both MFC and CRT from DLLs. ... Microsoft MVP, MCSD ... > Alexander Nickolov: ...
    (microsoft.public.vc.atl)
  • Re: Headless Systems
    ... configuration, so I usually start with IABASE and use the NOP display ... > the board with MFC but to get a program to even compile I had to include ... but It would not compile due to undefined LPDOCINFO struct... ...
    (microsoft.public.windowsce.embedded)
  • Re: Stopping false memory leak traces
    ... > by the CRT when retail and debug versions of the MFC library are ... > building uses the MFC debug version. ... > Any static objects declared in my DLL get reported as memory leaks, ... They are then clearly freed by the CRT when my DLL ...
    (microsoft.public.vc.language)
  • Re: "Application has failed to start..." error message with VS2005 on new machine
    ... Do you do dynamic link with MFC and CRT? ... I would suggest you to try to static-link with MFC and CRT, ...
    (microsoft.public.vc.mfc)