Replies: 2 comments
-
| I have the same problem. I followed all the instructions and guides but it fails to create the .exe when I change the cwd from  | 
Beta Was this translation helpful? Give feedback.
-
| cwd is generally not something you want to change as it leads to more issues more often than not, you can instead try switching to CMake as it's far more flexible in this regard, and then copying the .txt file to the output directory with add_custom_command, or perhaps making a bash script that will copy that .txt file to output directory (like some do for .dll files), or even setting a cmake directory variable that leads to wherever that .txt file is located. | 
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am working on a project where
input.txtis in the same level as the file to compile.However, the outputs are found in
/root/output/Running the file through the extension keeps the
cwdto/root/and the input file won't be found.I am unable to find any sort of documentation to find a solution to my issue.
The
cwdproperty fortasks.jsonseems to only apply to the compiler part.Is forsaking the extension's Run C/C++ File the only option for me?
I had success for changing the
cwdforlaunch.jsonfor debugging but it doesn't apply for running the program.Here is my
tasks.json{ "version": "2.0.0", "tasks": [ { "type": "cppbuild", "label": "Build", "command": "C:/Compilers/mingw64/bin/gcc.exe", "args": [ "-g", "${workspaceFolder}/code/assembler.c", "-o", "${workspaceFolder}/code/output/assembler.exe" ], "options": { "cwd": "${workspaceFolder}/code/output" }, "problemMatcher": [ "$gcc" ], "group": { "type":"build", "isDefault":true, }, "detail": "Builds the project main file", }, ], }Beta Was this translation helpful? Give feedback.
All reactions