8000 The boost::process example and my project also don't build on the latest version of boost 1.88.0 · Issue #1034 · boostorg/boost · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

The boost::process example and my project also don't build on the latest version of boost 1.88.0 #1034

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
igorekRnd opened this issue May 5, 2025 · 2 comments

Comments

@igorekRnd
Copy link

The example is taken from the previous version of boost 1.87.0 (https://www.boost.org/doc/libs/1_87_0/doc/html/process.html), because the latest version 1.88.0 does not contain documentation on Process.

#include <boost/process.hpp>

#include <string>
#include <iostream>

using namespace boost::process;

int main()
{
    ipstream pipe_stream;
    child c("gcc --version", std_out > pipe_stream);

    std::string line;

    while (pipe_stream && std::getline(pipe_stream, line) && !line.empty())
        std::cerr << line << std::endl;

    c.wait();
}

assembly line: LANG=C g++ test.cpp

compilation errors:

test.cpp:10:5: error: 'ipstream' was not declared in this scope
   10 |     ipstream pipe_stream;
      |     ^~~~~~~~
test.cpp:11:5: error: 'child' was not declared in this scope
   11 |     child c("gcc --version", std_out > pipe_stream);
      |     ^~~~~
test.cpp:15:12: error: 'pipe_stream' was not declared in this scope
   15 |     while (pipe_stream && std::getline(pipe_stream, line) && !line.empty())
      |            ^~~~~~~~~~~
test.cpp:18:5: error: 'c' was not declared in this scope
   18 |     c.wait();
      |     ^
@igorekRnd
Copy link
Author

dublicate from boostorg/process#480

@igorekRnd
Copy link
Author

To build the project I had to change the code a little:

#define BOOST_PROCESS_VERSION 1

#if BOOST_VERSION < 108800
#include <boost/process.hpp>
#else
#include <boost/process/v1/child.hpp>
#include <boost/process/v1/io.hpp>
#include <boost/process/v1/pipe.hpp>
#include <boost/process/v1/search_path.hpp>
#endif

namespace bp = boost::process;

In the future I plan to switch to Process::v2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0