Skip to content
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

Error in the documention #26

Open
jm130794 opened this issue Mar 7, 2023 · 0 comments
Open

Error in the documention #26

jm130794 opened this issue Mar 7, 2023 · 0 comments

Comments

@jm130794
Copy link

jm130794 commented Mar 7, 2023

Hello,

In the documentation, this sample doesn't work :

subprocess::command cmd("touch " + file_path.string()).run();
#include <iostream>
#include <filesystem>
#include <subprocess/subprocess.hpp>

using namespace subprocess::literals;

int main()
{
    std::filesystem::path file_path{"/tmp/file.txt"};
    
    // error
    //subprocess::command cmd("touch " + file_path.string()).run();

    // ok
    subprocess::command cmd2("touch " + file_path.string());
    cmd2.run();
}

When I try to compile, I get this errror on gcc 11 👍

main.cpp: In function 'int main()':
main.cpp:12:59: error: expected ',' or ';' before '.' token
   12 |     subprocess::command cmd("touch " + file_path.string()).run();
      |                                                         

Is this an error in the documentation?

Jean-Marc

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