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
So as the title says, my VS code is not giving me output for even a code like cout<<"Helloworld". I watched a bunch of videos and tried to solve the issue but it was without any success. The code keeps running and is opened in an external terminal and the terminal closes as soon as it is opened and if I try to run a code that requires an input then the terminal closes as soon as it gets the input, so it would be great if anyone can help me with this issue .
Hi bobbrow,
sorry for the late reply. I was busy with my exams so I couldn't test it out.
Now according to your solution, I can't find the term console in my launch.json. I can only find the term "externalconsole" which expects a true or false value.
Please have a look at my launch.json file:
{
"version": "0.2.0",
"configurations": [
{
"name": "g++.exe build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true, //set to true to see output in cmd instead
"MIMode": "gdb",
"miDebuggerPath": "C:\MinGW\bin\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "g++.exe build active file"
},
{
"name": "g++ build & run active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false, //set to true to see output in cmd instead
"MIMode": "gdb",
"miDebuggerPath": "C:\MinGW\bin\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "g++ build & run active file"
}
]
}
C:\MinGW\bin\gcc.exe --version should output the version. Version 10+ is recommended and 4 or less is not recommended. You can get newer versions at https://www.msys2.org/ .
i did install the latest version from mysys. I was on version 6.3.0 and from mysys i got version 12.2.0-10 but for some reasons, when i put gcc --version, it still shows me version 6.3.0 and in mysys, it says command not found
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
So as the title says, my VS code is not giving me output for even a code like cout<<"Helloworld". I watched a bunch of videos and tried to solve the issue but it was without any success. The code keeps running and is opened in an external terminal and the terminal closes as soon as it is opened and if I try to run a code that requires an input then the terminal closes as soon as it gets the input, so it would be great if anyone can help me with this issue .
All reactions