You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG]: Compiler ARGS not taken over/considered when running build with g++ on Win10 #6366
When compiling a simple c++ programm like "hello world" or just want to compile 2 or 3 files and link them together by adapting the tasks.json file, every change in the file works until the args part.
I you change the **args**like change the output filename or using *.cpp instead of ${file}.
The compiler only uses the active file and nothing else!
Steps to Reproduce:
create the "hello world" example from Documentation
change the compiler "args" in tasks.json like an other output name, or change the args to be able to compile multiple files
run Task
the changes in "args" are not considered!
Hint:
On MAC and Linux there is no problem, it works fine.
On Win10 it does not work!
Elaheh Rashedi (@elahehrashedi) The problem is that F5 (Build and Debug Active File) is causing the wrong build task to be run, i.e. the default build task is not run (it's using the pre-generated task). I see it working correctly when Run Build Task is used.
Sean McManus (@sean-mcmanus) I testet your proposal. BUT it does not work. same behavior as before.
My actual workaround is making a batch file with the following code: g++ -o test.exe *.cpp
Yeah, you're right -- I'm seeing changing the label/name causes the correct tasks to be run, but the args are not correct still, i.e. there appear to be 2 bugs in the same scenario.
However, I'm hitting this bug on Mac/Linux as well. I'm pretty sure this bug would occur on Mac/Linux if 1.1.0-insiders or 1.1.0-insiders2 is used. Could Mac/Linux be using 1.0.1?
We have a Makefile Tools extension that will use the makefile to configure IntelliSense. It's in a private preview. Bob Brown (@bobbrow) may be able to add you the list.
Hasenradball (@hasenradball), let me know if you are interested in joining the preview and I will send you an invite to the repository where you can download the Makefile Tools extension.
Sean McManus (@sean-mcmanus) Hi I tested the insiders2/3 on my MAC and there is absolutely no problem on the MAC.
Only change the tasks.json and it works fine.
Extensions can add their own activity bars. What do you mean by "Standard Build activity"? We weren't planning to add a build activity bar. I'm not sure what would be in that pane. If you have an idea for how that would be useful, could you file a new feature request issue?
Hi in the c++ extension at the left there is a button for starting Debug.
Is it possible to add a button at this activity bar for starting the default build?
As a short cut.
Activity
sean-mcmanus commentedon Oct 21, 2020
I repro the issue. Looks like a regression from 1.1.0-insiders/2. Downgrading to 1.0.1 and changing the task type to "shell" should be a workaround.
sean-mcmanus commentedon Oct 22, 2020
Elaheh Rashedi (@elahehrashedi) The problem is that F5 (Build and Debug Active File) is causing the wrong build task to be run, i.e. the default build task is not run (it's using the pre-generated task). I see it working correctly when Run Build Task is used.
sean-mcmanus commentedon Oct 22, 2020
Hasenradball (@hasenradball) A workaround is to change the label in tasks.json and the preLaunchTasks to match that new name in launch.json.
hasenradball commentedon Oct 22, 2020
Ok thanks for the reply.
But why is it only in win10 the case?
hasenradball commentedon Oct 22, 2020
Sean McManus (@sean-mcmanus) I testet your proposal. BUT it does not work. same behavior as before.
My actual workaround is making a batch file with the following code:
g++ -o test.exe *.cppWith the batch erverything works fine.
hasenradball commentedon Oct 22, 2020
Sean McManus (@sean-mcmanus)
One Question, is it possible to use a makefile in vscode?
sean-mcmanus commentedon Oct 22, 2020
Yeah, you're right -- I'm seeing changing the label/name causes the correct tasks to be run, but the args are not correct still, i.e. there appear to be 2 bugs in the same scenario.
However, I'm hitting this bug on Mac/Linux as well. I'm pretty sure this bug would occur on Mac/Linux if 1.1.0-insiders or 1.1.0-insiders2 is used. Could Mac/Linux be using 1.0.1?
We have a Makefile Tools extension that will use the makefile to configure IntelliSense. It's in a private preview. Bob Brown (@bobbrow) may be able to add you the list.
bobbrow commentedon Oct 22, 2020
Hasenradball (@hasenradball), let me know if you are interested in joining the preview and I will send you an invite to the repository where you can download the Makefile Tools extension.
sean-mcmanus commentedon Oct 23, 2020
The fix is available in https://github.com/microsoft/vscode-cpptools/releases/tag/1.1.0-insiders3 , but the launch.json label and tasks.json name has to not match the default generated. one. If you're still reproing the bug then we might need more repro info.
This is a screenshot of the "${workspaceFolder}\*.c" compiling multiple .c files in the workspace using mingw on Windows.

I'm using
tasks.json
and launch.json
hasenradball commentedon Oct 23, 2020
Hi thank you is the fix automatically installed?
How to install a specific version of c/c++?
On my linux I have also the insiders2 instslled.
hasenradball commentedon Oct 23, 2020
Sean McManus (@sean-mcmanus) Hi I tested the insiders2/3 on my MAC and there is absolutely no problem on the MAC.
Only change the tasks.json and it works fine.
on the Win Machine I will test it today..
hasenradball commentedon Oct 23, 2020
Sean McManus (@sean-mcmanus)
Hi I tested now the Insiders3 on Win10.
I have done the following:
Result:
everything is fine now, args are taken over an considered on Win10!
Thanks for your Support!!!
hasenradball commentedon Oct 23, 2020
Sean McManus (@sean-mcmanus) Hi I have one short question....
Is it possible to add the Standard Build activity to the Activity bar to the left?
I havent found to modify the activity bar.
sean-mcmanus commentedon Oct 27, 2020
Extensions can add their own activity bars. What do you mean by "Standard Build activity"? We weren't planning to add a build activity bar. I'm not sure what would be in that pane. If you have an idea for how that would be useful, could you file a new feature request issue?
hasenradball commentedon Oct 27, 2020
Hi in the c++ extension at the left there is a button for starting Debug.
Is it possible to add a button at this activity bar for starting the default build?
As a short cut.