Boost logo

Boost :

From: Ross Smith (ross.s_at_[hidden])
Date: 2001-05-21 16:18:36


John Maddock wrote:
>
> >I've been trying the boost::regex library with the various compilers I
> >use. It works fine with Cygwin's GCC 2.95.3, but with VC6 I can't get it
> >to compile:
>
> Did you run the configure script when you tried with gcc - it looks like it
> as the errors that you're getting seem to be config related - try
> re-extracting from the zip. You do not need to run the configure script
> for VC6 builds. If this doesn't fix things let me know - you certainly
> should not have any problems with VC6.

On further testing, the plot thickens.

I'd forgotten that I originally had a problem building with GCC. My
first attempt gave me this error:

/d/cplusplus/libraries/boost_1_21_2/libs/regex/build$ make -f gcc.mak
g++ -o gcc/boost_regex/c_regex_traits.o -c -O2 -I../../../
../src/c_regex_traits.cpp
g++ -o gcc/boost_regex/c_regex_traits_common.o -c -O2 -I../../../
../src/c_regex_traits_common.cpp
g++ -o gcc/boost_regex/cpp_regex_traits.o -c -O2 -I../../../
../src/cpp_regex_traits.cpp
g++ -o gcc/boost_regex/cregex.o -c -O2 -I../../../ ../src/cregex.cpp
In file included from ../src/cregex.cpp:27:
../../../boost/regex/detail/fileiter.hpp:31: #error "Sorry, can't mix
<windows.h> with STL code and gcc compiler: if you
 ran configure, try again with configure --disable-ms-windows"
make: *** [gcc/boost_regex/cregex.o] Error 1
/d/cplusplus/libraries/boost_1_21_2/libs/regex/build$

My first impulse then was to try the configure+make approach. Configure
seemed to run OK but make didn't like the results:

/d/cplusplus/libraries/boost_1_21_2/libs/regex$ make
sh dmi.sh lib
make[1]: Entering directory
`/d/cplusplus/libraries/boost_1_21_2/libs/regex/lib'
make[1]: *** No targets. Stop.
make[1]: Leaving directory
`/d/cplusplus/libraries/boost_1_21_2/libs/regex/lib'
make: *** [build/libboost_regex.a] Error 1
/d/cplusplus/libraries/boost_1_21_2/libs/regex$

Thinks: OK, that's obviously broken too, let's go back to the original
makefile and see if I can figure out what's going on. So I deleted the
files that configure had created in its directory (config.cache,
config.log, config.status, makefile), and went back to the build
directory to try again, because I hadn't recorded the error message the
first time and wanted to see it again. But _now_ everything works!

Obviously the attempt at configure must have updated a file I missed;
some fiddling with multiple copies of the boost tree and diff -r
suggests it was regex/detail/regex_options.hpp.

(At a guess, could the original GCC error be connected with Cygwin's
recent change to defaulting to -mno-win32?)

After that, I tried the VC6 build, and got the error I described
earlier. After I saw your reply, I went back and tried again with a
freshly unpacked boost tree, and sure enough, now it works. (It took a
hell of a long time, though. Are all those different versions it builds
really necessary?)

So: Out of the box, VC6 works and Cygwin GCC doesn't. (I haven't tried
it with GCC on my Linux box yet; presumably it would work if my guess
about the cause is correct.) If I run configure, but forget about the
makefile it generates and run gcc.mak instead, it works, but now VC6 no
longer works.

I'm sure you'll be able to make more sense out of all this than I :-)

-- 
Ross Smith <ross.s_at_[hidden]> The Internet Group, Auckland, New Zealand
========================================================================
        "Hungarian notation is the tactical nuclear weapon of
         source code obfuscation techniques." -- Roedy Green

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