15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


ATL/MFC Link Problems

Joseph Jones -- jjones@FrontofficeTech.com
Tuesday, February 25, 1997

Environment: NT 4.0 MSVC 4.2b
Hi all,

	I've created a DLL using the ATL 1.1 wizard. My DLL uses MFC. When
compiling in the IDE, everything is hunky-dorry. Unfortunately, wen
compiling on the commmand line (using nmake), I get the followin link
errors:

	nafxcwd.lib error: LINK 2005: _DllMain@12 already defined in
LIBCMTD.LIB
	nafxcwd.lib error: LINK 2005: operator new already defined in
LIBCMTD.LIB
	nafxcwd.lib error: LINK 2005: operator delete already defined in
LIBCMTD.LIB

	I don't understand why this is happening only on the command line. Any
help at all would be greatly appreciated.

TIA

joe




Mike Sargent -- msargent@entrust.com
Thursday, February 27, 1997

[Mini-digest: 3 responses]

We ran across this same problem with 4.1. We solved it by turning on the
"Ignore all default libraries" check box in the Link tab of the Project
Settings dialog. When you do that you will need to list all of the
needed libraries in the "Object/library modules" field. There is an
Excel .csv file in your msdev directory which can help you find which
libraries you need. As a starting point, here is a sample of what we
use:

ctl3d32.lib oldnames.lib wsock32.lib kernel32.lib user32.lib shell32.lib
advapi32.lib comdlg32.lib gdi32.lib comctl32.lib winspool.lib winmm.lib

Your mileage may vary.  :-)

	Mike

>----------
>From: 	jjones@frontofficetech.com[SMTP:jjones@frontofficetech.com]
>Sent: 	Tuesday, February 25, 1997 10:00 PM
>To: 	mfc-l@netcom.com
>Subject: 	ATL/MFC Link Problems
>
>Environment: NT 4.0 MSVC 4.2b
>Hi all,
>
>	I've created a DLL using the ATL 1.1 wizard. My DLL uses MFC. When
>compiling in the IDE, everything is hunky-dorry. Unfortunately, wen
>compiling on the commmand line (using nmake), I get the followin link
>errors:
>
>	nafxcwd.lib error: LINK 2005: _DllMain@12 already defined in
>LIBCMTD.LIB
>	nafxcwd.lib error: LINK 2005: operator new already defined in
>LIBCMTD.LIB
>	nafxcwd.lib error: LINK 2005: operator delete already defined in
>LIBCMTD.LIB
>
>	I don't understand why this is happening only on the command line. Any
>help at all would be greatly appreciated.
>
>TIA
>
>joe
>
>
>
-----From: "Ron Jacobs" 

     Check your environment variables.  The IDE uses the settings for Libs 
     and include directories under the tools/options menu.  However, 
     command line builds use the envrionment strings.  If these are 
     different, you might be linking with a different version of a lib than 
     you are in the IDE.
     
     Ron Jacobs
     Ron.Jacobs@centurasoft.com
     


______________________________ Reply Separator _________________________________
Subject: ATL/MFC Link Problems
Author:  mfc-l@netcom.com at SMTPLINK-GC
Date:    2/26/97 10:08 PM


Environment: NT 4.0 MSVC 4.2b
Hi all,
     
 I've created a DLL using the ATL 1.1 wizard. My DLL uses MFC. When
compiling in the IDE, everything is hunky-dorry. Unfortunately, wen 
compiling on the commmand line (using nmake), I get the followin link 
errors:
     
 nafxcwd.lib error: LINK 2005: _DllMain@12 already defined in
LIBCMTD.LIB
 nafxcwd.lib error: LINK 2005: operator new already defined in
LIBCMTD.LIB
 nafxcwd.lib error: LINK 2005: operator delete already defined in
LIBCMTD.LIB
     
 I don't understand why this is happening only on the command line. Any
help at all would be greatly appreciated.
     
TIA
     
joe
     

-----From: Joseph Jones 

Environment: NT 4.0 MSVC 4.2b

I figured it out the day after sending this message. It seems that
nafxcwd.lib was not getting linked first on the command line. I fixed
this by specifying nafxcwd.lib in the INpu line of the Link tab page in
the IDE.

joe


>-----Original Message-----
>From:	Joseph Jones 
>Sent:	Tuesday, February 25, 1997 7:01 PM
>To:	'MFC List'
>Subject:	ATL/MFC Link Problems
>
>Environment: NT 4.0 MSVC 4.2b
>Hi all,
>
>	I've created a DLL using the ATL 1.1 wizard. My DLL uses MFC. When
>compiling in the IDE, everything is hunky-dorry. Unfortunately, wen
>compiling on the commmand line (using nmake), I get the followin link
>errors:
>
>	nafxcwd.lib error: LINK 2005: _DllMain@12 already defined in
>LIBCMTD.LIB
>	nafxcwd.lib error: LINK 2005: operator new already defined in
>LIBCMTD.LIB
>	nafxcwd.lib error: LINK 2005: operator delete already defined in
>LIBCMTD.LIB
>
>	I don't understand why this is happening only on the command line. Any
>help at all would be greatly appreciated.
>
>TIA
>
>joe
>




Become an MFC-L member | Вернуться в корень Архива |