Boost logo

Boost Users :

Subject: [Boost-users] query regarding parallel algorithms and error message
From: ian D Chivers (ian_at_[hidden])
Date: 2018-06-24 10:58:50


I have installed boost to work with

Windows

  Microsoft Visual C++

  Cygwin g++

Linux

  openSuSe

I can compile and run test programs
On all three versions.

However I get the following error messages when trying To call one of the
routines in

https://www.boost.org/doc/libs/1_67_0/libs/sort/doc/html/sort/parallel.html

Here is the cygwin message

$ g++ ch3604.cxx
ch3604.cxx: In function 'int main()':
ch3604.cxx:155:3: error: 'parallel_stable_sort' was not declared in this
scope
   parallel_stable_sort( x.begin() , x.end() );

Here is the Microsoft message

C:\document\cpp\examples>cl /EHsc /I "C:\Program Files\boost\boost_1_67_0"
-O2 /F 1000000000 ch3604.cxx
Microsoft (R) C/C++ Optimizing Compiler Version 19.13.26129 for x64
Copyright (C) Microsoft Corporation. All rights reserved.

ch3604.cxx

I get a similar message on openSuSe linux.

Here is the top part of the source file

#####

#include <iostream>
#include <algorithm>
#include <array>
#include <chrono>
#include <random>
#include <string>
#include <boost/sort/sort.hpp>

using namespace std;

#####

Here is a section of the main program

#####

  parallel_stable_sort( x.begin() , x.end() );

  heading = "Boost sort ";
  t = timer_01.elapsed();
  print_time(heading, t);

  cout << x[0] << " " << x[nr-1] << endl;

#####

I get similar messages when trying to use any of the serial
Or parallel routines.

The documentation says that I only need to include

#include <boost/sort/sort.hpp>

To make things available.

Any thoughts?

Ian Chivers


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net