Boost logo

Boost :

From: Eric Niebler (eric_at_[hidden])
Date: 2006-07-15 12:40:11


John Maddock wrote:
> Wang Weiwei wrote:
>>> Hello,
>>>
>>> I have done a test, on WinXP + VS.net 2003, with regex lib as
>>> follows ,
>>>
>>> A created a new 'Win32 Console Project', I selected MFC and
>>> pre-compiled header support. Leave other settings default.
>>>
>>> Then I created a skeleton project that can compile. Then I added
>>>
>>> #include <boost/regex.hpp>
>>>
>>> in the main cpp file. When I then compiled the program in debug
>>> mode, I got a "error C2665" at regex_raw_buffer.hpp(177) - ¡°operator
>>> new.
>>> When I compiled it in release mode, it's Ok.
>>>
>>> Anybody know how about this phenomenom?
>
> Weird, no.
>
> Regex is used and tested with VC8 a lot, although I admit I'm not in a
> position to test it with MFC. It's not as simple as adding:
>
> #include <new>
>
> to the top of that file is it?
>
> John.

<educated guess>

MFC does some nasty things like "#define new DEBUG_NEW". And I bet
regex_raw_buffer.hpp(177) has an invocation of placement new. Try
including the boost headers before the MFC headers, or find where MFC is
monkeying with the definition of "new" and delete it.

</educated guess>

-- 
Eric Niebler
Boost Consulting
www.boost-consulting.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk