Boost logo

Boost :

From: Jonathan Wakely (cow_at_[hidden])
Date: 2004-11-29 04:42:39


On Sun, Nov 28, 2004 at 10:49:07PM +0100, Maciej Sobczak wrote:

> Hi,
>
> $ g++ --version
> g++ (GCC) 3.4.2 [FreeBSD] 20040728
>
> (boost version 1.32)
>
> When compiling a very simple example for the regex library, I've got the
> following error:
>
> In file included from
> /usr/local/include/boost_1_32_0/boost/regex/v4/regex.hpp:99,
> from /usr/local/include/boost_1_32_0/boost/regex.hpp:34,
> from regex.cc:1:
> /usr/local/include/boost_1_32_0/boost/regex/v4/instances.hpp:71: error:
> ISO C++ forbids the use of `extern' on explicit instantiations
> *** Error code 1

Where you compiling with -pedantic ?

AFAIK all versions of GCC reject this with -pedantic, but otherwise
allow it as a GNU extension.

> IMHO (and rather guessing), the #define in (*) is performed
> unnecessarily for g++ 3.4.2, but is executed just because of too generic
> __GNUC__ a little bit higher.

libstdc++ uses _GLIBCXX_EXTERN_TEMPLATE (or _GLIBCPP_EXTERN_TEMPLATE)
in bits/istream.tcc to test whether to use the extern template syntax.
That should probably be used by Boost.Regex too.

jon

-- 
This space left intentionally blank.

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