DEV Community

Discussion on: Live Input Output (Competitive Programming) setup in VS CODE for C/C++ (WINDOWS)

 
viissgg profile image
Vijay • Edited

I figured it out. Problem was same. Git shell was not recognizing the path. The path parameter should be in quotes. Below is the fix.

In args, make these changes.

"${file}" -> "'${file}'"
"${workspaceFolder}" -> "'${workspaceFolder}'"
"${fileBasename'" -> "'${fileBasename}'",

Enter fullscreen mode Exit fullscreen mode
"args": [
        "cp",
        "'${file}'",
        "'${workspaceFolder}'",
        "&&",
        "g++",
        "'${fileBasename}'",
        "-o",
        "test.out",
        "&&",
        "./test.out",
        "<",
        "input.txt",
        ">",
        "output.txt",
        "&&",
        "rm",
        "*out",
        "&&",
        "rm",
        "'${fileBasename}'"
      ],
Enter fullscreen mode Exit fullscreen mode
Thread Thread
 
mh_shifat profile image
5hfT

thats great if you have figured it out but i have tested my previous task.json file and it is working fine with other machines!
I think windows have some issues with file management system though its all working file in Linux.

Thread Thread
 
akib35 profile image
akib35 • Edited

I had same problems too. After adding extra ( ' ' ) made it successful suggested by kikit.
Thanks.

Thread Thread
 
mh_shifat profile image
5hfT

Most welcome.

Thread Thread
 
mh_shifat profile image
5hfT

I will check it and will update the repo