Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2004-11-29 08:46:19


> When compiling a very simple example for the regex library, I've got the
> following error:

> A short investigation points to the following code in the instances.hpp
> file:

> As a temporary solution, I have just uncommented the following line in
> boost/regex/user.hpp:
>
> #define BOOST_REGEX_NO_EXTERNAL_TEMPLATES
>
> Now the simple program compiles and works fine. What influence will the
> above change in user.hpp have on bigger programs?

They'll take longer to compile, have bigger object files, and if you're
linking to the shared library, be a larger program as well.

> Is this a known problem?

It is now :-)

I can only reproduce this when compiling with -pedantic, the following fix
will be going into cvs shortly:

Index: instances.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/regex/v4/instances.hpp,v
retrieving revision 1.10
diff -u -r1.10 instances.hpp
--- instances.hpp 12 Mar 2004 13:12:25 -0000 1.10
+++ instances.hpp 29 Nov 2004 13:42:52 -0000
@@ -60,7 +60,11 @@
 #elif (defined(BOOST_MSVC) && defined(_MSC_EXTENSIONS)) ||
defined(__GNUC__)

 # ifndef BOOST_REGEX_INSTANTIATE
-# define template extern template
+# ifdef __GNUC__
+# define template __extension__ extern template
+# else
+# define template extern template
+# endif
 # endif

 # ifdef BOOST_MSVC

John.


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