Terminal doesn't display anything from my cout #12558
Unanswered
PilatiEric
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is a problem I've been struggling with for months. I'm trying to study C++ and a while back the program just seemed to break. I've tried uninstalling and reinstalling VS Code. I've tried searching for answers online, even finding some stuff involving an almost identical issue that pointed to the files in your .vscode folder, but no success.
Here's what I've done thus far to solve the issue.
I've tried running a simple program:
`
#include
using namespace std;
int main()
{
cout << "Hello, World!" << endl;
return 0;
}
`
However, when I run and debug the program, this is all I get:
PS C:\Users\screa\Workspaces\Udemy-CPP-Course-1> & 'c:\Users\screa\.vscode\extensions\ms-vscode.cpptools-1.21.6-win32-x64\debugAdapters\bin\WindowsDebugLauncher.exe' '--stdin=Microsoft-MIEngine-In-gna04pr4.lyy' '--stdout=Microsoft-MIEngine-Out-5qnvlkkj.wjs' '--stderr=Microsoft-MIEngine-Error-3euconf5.d5h' '--pid=Microsoft-MIEngine-Pid-wsq1mspz.2j2' '--dbgExe=C:\mingw64\bin\gdb.exe' '--interpreter=mi'
The .exe files run fine when ran from a command line, so obviously there's nothing wrong with them.
The only leads I ever found, like I said above have to do with the contents of my .vscode folder in my workstation. In case it helps at all, here are mine:
launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/a.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "C:\mingw64\bin\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "build cpp programs"
}
]
}
tasks.json
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: g++.exe build active file",
"command": "C:\mingw64\bin\g++.exe",
"args": [
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${fileDirname}\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Task generated by Debugger."
}
],
"version": "2.0.0"
}
Keep in mind that my workstation didn't even have a launch.json file when I came across the other discussion in this forum.
I've been entirely demotivated from practicing C++ because of this issue and I just want to solve it so I can keep studying. Does anyone have any idea on how I can troubleshoot the issue or what I need to fix? Keep in mind that a vast majority of my knowledge on anything programming is involved in the OOP side of things, so please treat me like I know nothing. I'm grateful for any and all advice you all can give.
Beta Was this translation helpful? Give feedback.
All reactions