Re: [boost] [Boost-users] [ScopeExit/Typeof] Can't build simple test in debugmode (MSVC 7.1 and 8.0)

It applies to ScopeExit I see. It seems to be caused by the use of __LINE__, (see http://article.gmane.org/gmane.comp.lib.boost.user/17341/match=boost+edit+co ntinue). This makes sense as edit & continue would probably get a hard time with changing line numbers. But still it produces nonsense error messages. Best regards, Christian Larsen Christian Larsen wrote:
I've moved this to the dev list, because it should probably be mentioned in the documentation somewhere. I'm not sure whether it belongs in Typeof or ScopeExit.
I've tried building the hello.cpp example that comes with ScopeExit with the same results (as in my original message). I think I have narrowed down the cause. Building fails whenever "Program Database for Edit & Continue (/ZI)" is set in the project properties. Changing this to "Program Database (/Zi)" or any other fixes the problem. Is this a compiler bug?
I never use Edit & Continue anyway, but I thought it might be helpful to others to mention this problem somewhere.
Best regards, Christian Larsen
Christian Larsen wrote:
I'm trying build a very simple test program using ScopeExit (just downloaded from the link in the review notice: http://boost- consulting.com/vault/index.php?action=downloadfile&filename=sco pe_exit-0.04.tar.gz&directory=& ). I'm using a brand new download of Boost 1.34.1 with it. The following code builds and runs fine in release mode in both VC7.1 and 8.0, but fails to build in debug mode in both versions. I also tried specifying the BOOST_TYPEOF_COMPLIANT in MSVC7.1 debug but to no avail - I just get some other errors. I couldn't find any indication of what would cause this difference between debug/release builds. I tried disabling optimizations in release mode to check whether this would cause release mode to fail, too, but it didn't. Any help would be appreciated.
[SNIP]

Christian Larsen <contact <at> dword.dk> writes:
It applies to ScopeExit I see. It seems to be caused by the use of __LINE__, (see http://article.gmane.org/gmane.comp.lib.boost.user/17341/match=boost+edit+co ntinue). This makes sense as edit & continue would probably get a hard time with changing line numbers. But still it produces nonsense error messages.
Can you change it to __COUNT__ and check that it solves your problem? -- Alexander

Alexander Nasonov wrote:
Christian Larsen <contact <at> dword.dk> writes:
It applies to ScopeExit I see. It seems to be caused by the use of
__LINE__,
(see
http://article.gmane.org/gmane.comp.lib.boost.user/17341/match=boost+edit+ co
ntinue). This makes sense as edit & continue would probably get a hard time with changing line numbers. But still it produces nonsense error messages.
Can you change it to __COUNT__ and check that it solves your problem?
Yes, changing all occurrences of __LINE__ to __COUNT__ in scope_exit.hpp solves the problem in both versions of Visual Studio. Sorry for the late answer, I've been on vacation until today. Best regards, Christian Larsen
participants (2)
-
Alexander Nasonov
-
Christian Larsen