Boost logo

Boost :

From: Miko Nahum (miko_at_[hidden])
Date: 2005-11-10 02:12:31

I need your example in compilation errors on code uses boost under
Windows VC7 and HP-UX 11.11 aCC 3.55 in 64 bit mode.
We have the boost 1.31.0 successfully installed and used in our
products, in SunOS using Forte 6.5.3 CC, HP 11.11 using aCC 3.33,
Windows (W2k, XP) using VC6.
While porting our code to 64 bit, we have upgraded the development env`
to Forte 8.5.5 CC on Sun, aCC 3.55 on HP and VC7 on Windows.
Compilation of boost itself had no problem. However, compilation of our
products that using it has been failed on HP and Windows.
1. Problems on Windows:
We have the following piece of code that uses boost (copy/paste):
#include "boost/regex.h"
#include "boost/regex.hpp"
using namespace boost;
using namespace std;

typedef boost::reg_expression<char> re_type;
typedef re_type::allocator_type allocator_type;

long example_func(long pos, const std::string& regE, long& reslen, long
  long res;
  boost::match_results <PData::iterator, allocator_type> m;
  allocator_type (a);
  re_type e (a);
  e.set_expression (regE, regbase::normal);
  if (regex_search (begin (), end (), m, e, match_not_dot_newline |
match_not_dot_null)) <-- line 4790
    res = pos + m.position();
    reslen = m.length();
    return res;
Compiling the above produce the following error:
tcher_common.hpp(208) : error C2228: left of '.second' must have
class/struct/union type
        type is 'const std::allocator<_Ty>::value_type'
egex.hpp(243) : while compiling class-template member function 'bool
        c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xlocmon(190) : while compiling class-template member
tor,Allocator> &,const boost::reg_expression<charT>
earch.hpp(38) : see reference to class template instantiation
>' being compiled
        z:\med2\dev\ParserLib\parser.cpp(4790) : see reference to
function template instantiation 'bool
esults<BidiIterator,Allocator> &,const boost::reg_expression<charT>
&,boost::regex_constants::match_flag_type)' being compiled

"z:\med2\dev\ParserLib\parser.cpp(4790)" is marked above with red.
search.hpp(38)" is listed below:
template <class BidiIterator, class Allocator, class charT, class
traits, class Allocator2>
bool regex_search(BidiIterator first, BidiIterator last,
                  match_results<BidiIterator, Allocator>& m,
                  const reg_expression<charT, traits, Allocator2>& e,
                  match_flag_type flags = match_default)
   if(e.flags() & regex_constants::failbit)
      return false;
   re_detail::perl_matcher<BidiIterator, Allocator, traits, Allocator2>
matcher(first, last, m, e, flags); <-- line 38
   return matcher.find();

atcher_common.hpp(208)" is part of the following function:
template <class BidiIterator, class Allocator, class traits, class
bool perl_matcher<BidiIterator, Allocator, traits,

and the line (208) is listed below:
      // start again:
      search_base = position = m_result[0].second;
<-- line 208
      // If last match was null and match_not_null was not set then
      // our start position, otherwise we go into an infinite loop:

Searching Google for this problem did not help very much, so I was
wondering if you have encounter it and put more light on it and the
2. Problems on HP:
Error 24:
pp", line 53 # '<identifier>' expected instead of 'collate'.
          perlex = collate << 1, // perl extensions
Error 164:
pp", line 53 # Integral type expected for operator '<<'; types found
were '<no type>' and 'int'.
          perlex = collate << 1, // perl extensions
We do not understand why the error occurs, can you help with that? from
some reason, HP's aCC doesn't like the "collate".
Again, same as with problem #1, google it did not produce any useful
We have workaround this problem as follow:

     collate = icase << 1, // use locale specific
     perlex = collate << 1, // perl extensions


     collate = icase << 1, // use locale specific
     _collate = icase << 1,
     perlex = _collate << 1, // perl extensions

 What do you think about this solution?
2.2. Fixing above problem have exposed a problem similar to the Windows
Btw, both problems #1 and #2.2 were solved when set #define
Miko Nahum

Boost list run by bdawes at, gregod at, cpdaniel at, john at