Opened 19 years ago

Closed 19 years ago

Last modified 19 years ago

#234 closed Bugs (Wont Fix)

DevStudio 6.0 SP5 precompiled headers and regex

Reported by: gconklin Owned by: John Maddock
Milestone: Component: regex
Version: None Severity:
Keywords: Cc:

Description

trying out the new boost_1_31_0 and i'm having 
problems using the updated regex library as a 
precompiled header.

i was using 1.30.2 and had no troubles, though it seems 
more like a compiler problem (MSVC++ 6.0 SP5), so i 
don't know what can be done about it.

...\boost\regex\v4\perl_matcher_common.hpp(660) : 
fatal error C1001: INTERNAL COMPILER ERROR
        (compiler file 'msc1.cpp', line 1794) 
         Please choose the Technical Support command on 
the Visual C++ 
         Help menu, or open the Technical Support help 
file for more information

to recreate in a tiny project, all i did was (within the 
msvc gui) File|New|Projects select win32 console app.

Selected "A simple application" when asked what kind of 
console app i wanted to create.

Opened stdafx.h and added the line:
#include <boost\regex.hpp>
right after the generated TODO: line

Build|Rebuild All

I'd be curious if the .Net compiler had the same problem, 
but I assume it doesn't. I can say that if I pull the 
regex.hpp out of stdafx.h and put it into each .h or .cpp 
file that references boost::regex, I get a clean compile. 
However, I have dozens of tiny projects that would 
require this change.

Change History (4)

comment:1 by John Maddock, 19 years ago

Logged In: YES 
user_id=14804

I've tried all sorts of things to try and fix this, but I can't see 
any solution.  As you rightly say Visual Studio .NET and .NET 
2003 don't have this issue (I've checked).  The strange thing 
is, the pre-compiled header builds OK, it's only when you 
come to use it that the error occurs.  If anyone has any 
ideas I'd appreciate it.

John

comment:2 by John Maddock, 19 years ago

Status: assignedclosed
Logged In: YES 
user_id=14804

Following the instructions in 
http://support.microsoft.com/default.aspx?scid=kb;en-
us;195738 I have a workaround: change your project pre-
compiled header settings from "Use precompiled header file" 
to "Automatic use of precompiled headers".  I don't know 
what effect this has on compile times though - in theory 
none if you enter "stdafx.h" as the header name in the box 
provided (I've checked this works in your text case).

John.

comment:3 by gconklin, 19 years ago

Logged In: YES 
user_id=529585

Thanks for looking into this issue and your super-fast 
response. It's funny, that article said for win9x, but I'm on 
XP. Anyway, moving it to automatic seems to work for 
projects with one file, but when adding another class (.cpp/.h 
set) the problem pops up again.  Oh well, maybe time to look 
into upgrading the ol' compiler.
Anyway, thanks again, and thanks for all the work you do for 
the community.

comment:4 by gconklin, 19 years ago

Logged In: YES 
user_id=529585

I looked into this a little more and just messed around and 
tried various things. This isn't ideal, but may be of interest 
and help to others.

It doesn't really make any sense to me, but here's what I did.

I removed all these lines:

#ifdef BOOST_MSVC
#pragma warning(push)
#pragma warning(disable:4127)
#endif

#ifdef BOOST_MSVC
#pragma warning(pop)
#endif

throughout the file that was giving me problems (which at 
some point became perl_matcher_recursive.hpp).

Like I said, it doesn't make much sense, but thought I'd just 
make a note of my findings and what worked for me. Since it's 
just a pragma that disables warnings, I'm not too worried 
about my changes affecting functionality, though I haven't 
done extensive testing yet; just a quick run through of some 
of my apps that use regex.

Note: See TracTickets for help on using tickets.