I am trying to execute an application (Coq compiler) using C++ system() command on my Windows 10 machine. Here is my code:
string dospath = "coqc afile.v >> text.txt";
int errorno = system(dospath.c_str());
If there is a syntax/type error in afile.v, Coq returns a meaningful error message. Currently, I receive nothing in text.txt even if Coq returns an error (I see the error message in command prompt window of C++ application). I want to read that (any) message (returned by coqc) as a string or text in file text.txt. I know there are ways to do it using pstream.h but am not able to make them work on my Windows machine.