Boost logo

Boost Users :

Subject: Re: [Boost-users] [ASIO|Thread] Advice for removing MFC/afxwin.hdependancies
From: smbrown_at_[hidden]
Date: 2010-05-26 08:05:33


boost-users-bounces_at_[hidden] wrote on 26/05/2010 12:39:24:
> > With just two afxwin.h inclusions the linker error is:
> > nafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator
> > new(unsigned int)" (??2_at_YAPAXI@Z) already defined in
LIBCMTD.lib(new.obj)
> > nafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator
> > delete(void *)" (??3_at_YAXPAX@Z) already defined in
LIBCMTD.lib(dbgdel.obj)
> > nafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator
> > new[](unsigned int)" (??_U_at_YAPAXI@Z) already defined in
> > libcpmtd.lib(newaop.obj)
> > nafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator
> > delete[](void *)" (??_V_at_YAXPAX@Z) already defined in
> > LIBCMTD.lib(delete2.obj)
> >
> > I'm using /NODEFAULTLIB:libcmt.lib
>
> Does the following link help:
> http://support.microsoft.com/kb/148652

I've been doing some trial and error with /NODEFAULTLIB as suggest by MS
with not a vast amount of sucess.

I build using a makefile. If I exclude libcmt.lib I get the new and delete
problems shown above.

If I exclude nafxcwd.lib several of my objects have an unresolved external
of __afxForceEXCLUDE

My suspicion is moving away from boost and toward the Cypress USB library.
I didn't expect device drivers to use MFC.

If I explicitly include nafxcwd.lib in my library list, it links
sucessfully. :-(

Simon

++++ IMPORTANT NOTICE ++++

This email may contain confidential information and will be protected by copyright.
It is intended only for the use of the person(s) to whom it is addressed and any unauthorised use (including forwarding or dissemination the contents) may be unlawful. If you receive this email by mistake, please advise the sender immediately by using the reply facility on your email software and delete the email from your computer.

Opinions, conclusions and other information in this email that do not relate to the official business of this organisation shall be understood as neither given nor endorsed by it.

If this message forms part of a quotation for the supply of goods, the quotation is an invitation to treat only. No contract will come into effect until the Company issuing such quotation issues an acknowledgment of order for the supply of such goods. The contract will be on the terms of such acknowledgment of order.

------------------------------------------------------------------------
Teledyne Defence Limited
 
phone: +44 (0) 1274 531602
 
web: www.teledynedefence.co.uk
------------------------------------------------------------------------


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net