Boost logo

Boost :

From: Tim Hawes (Tim.Hawes_at_[hidden])
Date: 2002-05-01 09:01:50


On Tue, 2002-04-30 at 18:18, David Abrahams wrote:

> What do you consider "the stable boost distro"?
> FWIW, I consider the current CVS to be in much better shape than 1.27

I thought 1.27 was considered "stable" or at least more stable than CVS.
I had also tried the CVS version but kept getting this error when I
tried to compile against it:

test.cpp:
#include <boost/regex.hpp>
#include <iostream>

int main()
{
        boost::regex stitle("(.)*<title>(.)*",boost::regbase::icase); //
Find <title></title> tags.
        boost::regex meta("(.)*META name=\"SectionMember\"(.)*"); //
Find sectionmember meta tag.
        boost::RegEx *re = new boost::RegEx();
        _STL::cout << "Hello World!" << _STL::endl;
        delete re;
        return 0;
}

c++ -I/usr/local/gcc/gcc-3.0.4/include/stlport -I/usr/local/boost -c
test.cpp
In file included from /usr/local/boost/boost/regex.hpp:1541,
                 from test.cpp:1:
/usr/local/boost/boost/regex/detail/instances.hpp:116: template-id
   `compile_map<>' for `void boost::reg_expression<wchar_t,
   boost::regex_traits<wchar_t>, _STL::allocator<wchar_t>
>::compile_map(boost::re_detail::re_syntax_base*, unsigned int*,
unsigned
   int*, unsigned int, boost::re_detail::re_syntax_base*) const' does
not match any template declaration

> > (I am
> > writing a "time-sensitive" project to replace a perl cgi script that
> > eats system resources on a heavily loaded web server on Solaris). But
> > now, when I compile boost with gcc-stlport, I get an endless slew of
> > "<path>/include/stlport/stl/<some stlport header>:<some line number>
> > template with C linkage" messgaes and nothing gets compiled.
>
> Which part of boost do you get this error for? Can you post a single
> compilation command with one instance of the error (and any other prior
> errors in the output). There were some bugs in the version of
> Boost.Threads shipped with 1.27 having to do with "C" linkage, so if
> this is a threads-related failure I suggest you get the latest CVS or
> just compile the regex library from <boost-root>/libs/regex/build.

Here is where it starts:
jam -sBOOST_ROOT=. -sTOOLS=gcc-stlport -d+2
    g++ -c -Wall -ftemplate-depth-100 -DBOOST_REGEX_NO_LIB=1
-DBOOST_REGEX_STATIC_LINK=1 -D_STLP_DEBUG -g -O0 -fno-inline
-D_STLP_USE_DYNAMIC_LIB -I"libs/regex/build" -I"." -isystem
"/usr/local/gcc/gcc-3.0.4/include/stlport" -isystem
"c:/downloads/STLPort-0601/stlport" -o
"libs/regex/build/bin/libboost_regex.a/gcc-stlport/debug/runtime-link-dynamic/c_regex_traits.o" "libs/regex/build/../src/c_regex_traits.cpp"

In file included from
/usr/local/gcc/gcc-3.0.4/include/stlport/stl/_algobase.h:51,
                 from
/usr/local/gcc/gcc-3.0.4/include/stlport/stl/_list.h:34,
                 from /usr/local/gcc/gcc-3.0.4/include/stlport/list:35,
                 from libs/regex/src/c_regex_traits.cpp:27:
/usr/local/gcc/gcc-3.0.4/include/stlport/stl/_pair.h:37: template with C
   linkage
/usr/local/gcc/gcc-3.0.4/include/stlport/stl/_pair.h:52: template with C
   linkage
/usr/local/gcc/gcc-3.0.4/include/stlport/stl/_pair.h:61: template with C
   linkage
/usr/local/gcc/gcc-3.0.4/include/stlport/stl/_pair.h:67: template with C
   linkage
/usr/local/gcc/gcc-3.0.4/include/stlport/stl/_pair.h:75: template with C
   linkage
/usr/local/gcc/gcc-3.0.4/include/stlport/stl/_pair.h:80: template with C
   linkage
/usr/local/gcc/gcc-3.0.4/include/stlport/stl/_pair.h:85: template with C
   linkage
/usr/local/gcc/gcc-3.0.4/include/stlport/stl/_pair.h:90: template with C
   linkage
/usr/local/gcc/gcc-3.0.4/include/stlport/stl/_pair.h:101: template with
C
   linkage
/usr/local/gcc/gcc-3.0.4/include/stlport/stl/_pair.h:108: template with
C
   linkage
/usr/local/gcc/gcc-3.0.4/include/stlport/stl/_pair.h:115: template with
C
   linkage
/usr/local/gcc/gcc-3.0.4/include/stlport/stl/_pair.h:123: template with
C
   linkage
/usr/local/gcc/gcc-3.0.4/include/stlport/stl/_pair.h:134: template with
C
   linkage
/usr/local/gcc/gcc-3.0.4/include/stlport/stl/_pair.h:139: template with
C
   linkage
/usr/local/gcc/gcc-3.0.4/include/stlport/stl/_pair.h:144: template with
C
   linkage
/usr/local/gcc/gcc-3.0.4/include/stlport/stl/_pair.h:149: template with
C
   linkage

And continues ad naseaum
Complete results at:
http://devel.dhhs.state.nc.us/~thawes/nohup.out

> > I can get boost to compile w/o stlport, now, but the program I have
> > written, for some reason, segfaults when I use std:: streams and works
> > hunky-dory when I use _STL:: streams.
>
> Do you mean that this happens when you use the GCC streams with STLPort?
> This is not a recommended configuration for STLPort; it's a clever hack
> that eventually breaks down if you push it too hard. If you mean that it
> segfaults with GCC streams without STLPort, I have no comment - it might
> be your code, or it could be libstdc++.
>

It segfaults with gcc stream without stlport. This was why I decided to
try stlport to begin with.

The program I was trying to compile can be found at:
http://devel.dhhs.state.nc.us/~thawes/main.cpp
(if you wanted to see it. You might want to wait and let me do some leg
work to try and produce some more specific questions about it).
What is there is currently utilizing gcc streams. It uses sstream so it
requires libstdc++v3.

This program will eventually parse a static html file and insert the
contents of a directory based on a fixed criteria, giving the name of
the documents based on what is in the <title></title> tags of an
index.htm file. It could potantially parse 20 - 30 documents w/ each
hit. You can see how this has become resource intensive with a perl
script doing the same thing.

Thanks


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