Link error (LNK2005) - Any suggestions 
Author Message
 Link error (LNK2005) - Any suggestions

The following error occurs in my VC4.2 or VC5.0 project. The only way
I have been able to correct this is by destroying and then recreating
my project. Then the error occurs again within a few compiles.

nafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator

LIBCMTD.lib(dbgdel.obj)

I think this may be an MFC related problem. Any suggestions would be
appreciated.
TIA

Marc



Sun, 10 Oct 1999 03:00:00 GMT  
 Link error (LNK2005) - Any suggestions

This is a multi-part message in MIME format.

--------------594029AE3BBB
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

--
Its a big enough umbrella,
                But its always me that ends up getting wet....

--------------594029AE3BBB
Content-Type: text/plain; charset=us-ascii; name="New Delete Conflict.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="New Delete Conflict.txt"

This is a fairly common problem, and there are several causes of why it happens.
The reason this is happening is that the libraries are being linked out of order
now why they are being linked out of order is the part that I can't say....
The fix is very simple, just do the following.

- Select BUILD|SETTINGS
- In the left hand pane highlight WIN32 Debug
- Go to the LINK tab
- Select the INPUT 'category'
- in the edit box labeled "Ignore Libraries" type the following two libs
   LIBCMTD.LIB, NAFXCWD.LIB   (order doesn't matter _here_)
- Now in the edit box labeled "Object/Library Modules" type the following two libs
   NAFXCWD.LIB, LIBCMTD.LIB
         MAKE SURE THEY ARE IN THIS ORDER AND THEY ARE LISTED AS THE FIRST &
         SECOND LIBS IN THE EDIT BOX

rebuild and all should be fine.  Basically what you di was tell the linker to
skip the implied inclusion of these libs, and then manually told it to include them
in the specfic order mentioned.
--------------594029AE3BBB--



Sun, 10 Oct 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. PRB: LNK2005 Errors When Link C Run-Time Libraries Are Linked Before MFC Libraries (Q148652)

2. Link Errors : error LNK2005 and LNK2004

3. Please Help! - Link Error LNK2005

4. help- Link error LNK2005

5. LNK2005 Link errors when doing Release Build??

6. link problem, error LNK2005 using CSocket

7. Please Help! - Link Error LNK2005

8. LNK2005 Link errors when doing Release Build??

9. Link Err LNK2005

10. Forcing a Link due to LNK2005

11. LNK2005 Errors

12. error LNK2005

 

 
Powered by phpBB® Forum Software