no matching function for call
Yo people!
so basically trying to run this process. I don't find a good answer anywhere.
what do I miss?
1 2 3 4 5 6 7 8 9 10
|
void myHandler(const char *event, const char *data)
{
std::string tt ("python /home/pi/Documents/testone.py");
std::string cmd;
cmd.append(tt);
std::string s=data;
cmd.append(s);
Process proc = Process::run(cmd);
proc.wait();
}
|
ERROR:
error: no matching function for call to 'Process::run(std::string&)' Process proc = Process::run(cmd);
cheers! ^
1 2 3 4 5 6 7 8 9 10 11
|
#include <string>
#include <cstdlib>
void myHandler( [[maybe_unused]] const char* event, const char *data)
{
static const std::string tt = "python /home/pi/Documents/testone.py" ;
const std::string cmd = tt + ' ' + data ; // space may (would) be required between arguments
std::system( cmd.c_str() ) ; // this is a blocking call
}
|
Thanks mate!
Line 8: You haven't shown the declaration for Process, so there is no way we can tell you what's wrong.
Topic archived. No new replies allowed.