Boost logo

Boost :

From: Richard Hadsell (hadsell_at_[hidden])
Date: 2005-08-19 15:03:42


After upgrading to Boost 1.33.0 I found a problem with my code when
built for Intel 8.0 on Linux. The problem doesn't show up with g++. I
reduced it to a simple test case. With Intel 8.0 it compiles but fails
to link the executable, complaining that it can't find the 'position'
and 'str' functions. Note that it does find the 'length' function.

I built the library with these options, and there were no errors:

bjam -sTOOLS=intel-linux -sINTEL_PATH=/usr/local/intel/compiler80/ia32 --with-python-root=/usr --without-iostreams --without-python --without-serialization --stagedir=stage -sBUILD="debug release <threading>single" stage

This copy of the console log documents the test case, working with g++
and failing to link with icpc:

% cat RegexIntelLinuxBug.cc

#include <iostream>
#include <boost/regex.hpp>

int main (int argc, const char * const *argv)
{
  static const boost::regex pat ("[[:alpha:]]+");
  const char str[] = "xyzzy";
  boost::cmatch what;
  if (! boost::regex_search (str, what, pat))
    std::cout << "not found" << std::endl;
  else {
    std::cout << "found '" << what.str () << "': " << what.length () <<
      " characters at position " << what.position () << std::endl;
  }
  return 0;
}
% g++ -I/u/hadsell/cgi/Include/libboost -c -o RegexIntelLinuxBug.o RegexIntelLinuxBug.cc
% g++ -o RegexIntelLinuxBug RegexIntelLinuxBug.o /u/hadsell/cgi/Lib/LINUX_X86FC3/libboostrgx.a
% RegexIntelLinuxBug
found 'xyzzy': 5 characters at position 0
% icpc -V
Intel(R) C++ Compiler for 32-bit applications, Version 8.0 Build 20040304Z Package ID: l_cc_pc_8.0.058_pe061
Copyright (C) 1985-2004 Intel Corporation. All rights reserved.

icpc: Command line error: no files specified; for help type "icpc -help"
% icpc -I/u/hadsell/cgi/Include/libboost -c -o RegexIntelLinuxBug.o RegexIntelLinuxBug.cc
% icpc -o RegexIntelLinuxBug RegexIntelLinuxBug.o /u/hadsell/cgi/Lib/LINUX_X86/libboostrgx.a
RegexIntelLinuxBug.o(.text+0x1b1): In function `main':
: undefined reference to `boost::match_results<char const*, std::allocator<boost::sub_match<char const*> > >::str(int) const'
RegexIntelLinuxBug.o(.text+0x1fe): In function `main':
: undefined reference to `boost::match_results<char const*, std::allocator<boost::sub_match<char const*> > >::position(unsigned) const'

-- 
Dick Hadsell			914-259-6320  Fax: 914-259-6499
Reply-to:			hadsell_at_[hidden]
Blue Sky Studios                http://www.blueskystudios.com
44 South Broadway, White Plains, NY 10601

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