升压中的进程
我正在使用 boost.process (用于提升的附加库)。在我提供的链接页面上,您可以找到使用示例。我安装了库,添加: #include
和一些以下代码:
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’
对于所有描述的示例,我都有这样的错误。怎么了?
我知道真正的命名空间应该是 process,但我查看了代码,发现它是用 boost
和 processes
命名空间包装的。所以没有任何process
命名空间。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否可能使用不同/旧/替代版本的升压过程,即您是否从 沙盒 最近?
如果您打开 boost/process.hpp,您是否会在顶部看到以下内容?
// 版权所有 (c) 2006, 2007 Julio M. Merino Vidal
// 版权所有 (c) 2008, 2009 Boris Schaeling
我记得过去有另一位作者提供的另一个版本的 boost 过程。
我查看了 Vidal/Schaeling 的一些进程文件,它们肯定都使用 boost::process 命名空间。如果您在源代码中没有看到这一点,则您可能正在使用其他版本。另外,我在 http://www.highscore.de 上提供的参考中没有看到任何命令行条目/boost/process/。仅供参考,boost 过程最近也经历了许多变化(在 boost 邮件列表上的讨论之后)。
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).
好吧,正如您自己所说,示例中的命名空间是
::boost::process
。行:namespace bp = ::boost::processes
仅定义了一个命名空间别名:
bp::
是boost::processes
的别名。编写bp::command_line
与编写boost::processes::command_line
完全相同。由于command_line
驻留在boost::process
命名空间中,因此找不到该类型。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 forboost::processes
. Writingbp::command_line
is exactly like writingboost::processes::command_line
. Ascommand_line
resides in theboost::process
namespace, the type is not found.