2

I'm using boost.process (additional lib for boost). At the page I gave for the link you can find samples of usage. I installed library, add: #include <boost/process.hpp> and some following code:

namespace bp = ::boost::processes; // In samples the namespace name is process!
bp::command_line temp("ls");

error: ‘command_line’ is not a member of ‘bp’

And I have such errors for all described samples. What's wrong?


I know that real namespace should be process, but I looked into the code and found that it's wrapped with boost and then processes namespaces. So there aren't any process namespace.

Max Frai
  • 52,556
  • 73
  • 182
  • 293
  • which sample are you trying to compile? I don't see `bp::command_line` referenced on the page you linked. – Sam Miller Nov 22 '10 at 17:40
  • there are many different versions of boost.process, see here http://stackoverflow.com/a/12327853/225186. Make sure you are using a consistent documentation. – alfC Sep 08 '12 at 09:20

2 Answers2

2

Are you not maybe using a different/older/alternate version of boost process i.e. did you get boost process from the sandbox recently? If you open up boost/process.hpp do you see the following at the top?

// Copyright (c) 2006, 2007 Julio M. Merino Vidal // Copyright (c) 2008, 2009 Boris Schaeling

I recall that there was another version of boost process by another author available in the past.

I had a look at some of the process files by Vidal/Schaeling and they definitely all use the boost::process namespace. If you do not see that in the source, you are prob using another version. Also, I did not see any entries for command_line in the reference available at http://www.highscore.de/boost/process/. FYI, boost process also went through numerous changes recently (following discussions on the boost mailing list).

Ralf
  • 9,082
  • 2
  • 24
  • 44
1

Well, as you say it yourself, the namespace from the samples is ::boost::process. The line :

namespace bp = ::boost::processes

only defines a namespace alias : bp:: is an alias for boost::processes. Writing bp::command_line is exactly like writing boost::processes::command_line. As command_line resides in the boost::process namespace, the type is not found.

icecrime
  • 66,755
  • 11
  • 95
  • 108
  • 1
    @Ockonal: Sorry then, please ignore my answer. I'd like to help more, but I can't download boost.process from work T_T – icecrime Nov 22 '10 at 12:58