I am trying to compile a project using the system keyword in my console application to call MSBuild. MSBuild spits out a project not found error, and I have no clue why. The path and project name are both correct and printed out. https://gyazo.com/624847f060e242ad702f16174ac75701
My code:
bool MSBuild::compile(std::string path, std::string solution) {
if (path.length() == 0 || solution.length() == 0)
return false;
std::string cmd1 = "cd ";
cmd1.append(path);
std::cout << "Command: " << cmd1 << std::endl;
std::string cmd2 = "msbuild ";
cmd2.append(solution);
cmd2.append(" /p:configuration=debug");
std::cout << "Command: " << cmd2 << std::endl;
system(cmd1.c_str());
system(cmd2.c_str());
return true;
}
I have confirmed MSBuild successfully compiles the project when manually inputting the same command with the same parameters into a cmd window. https://gyazo.com/a7f4c3f07f3f44b418734f4a979ca398