Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22216

Messy output for HelloWorld.cpp using gcc in vscode wsl [closed]

$
0
0

I am absolutely new to C++. I have followed VScode tutorial.

My helloWorld.cpp file is

#include <iostream>#include <vector>#include <string>using namespace std;int main(){   vector<string> msg {"Hello", "C++", "World", "from", "VS Code", "and the C++ extension!"};   for (const string& word : msg)   {      cout << word << " ";   }   cout << endl;}

And the output in the terminal is

Hello C++ World from VS Code and the C++ extension! [1] + Done                       "/usr/bin/gdb" --interpreter=mi --tty=${DbgTerm} 0<"/tmp/Microsoft-MIEngine-In-jj3rki1j.avi" 1>"/tmp/Microsoft-MIEngine-Out-k4dxtrne.ao2"

Instead of just

Hello C++ World from VS Code and the C++ extension! 

In the tasks terminal it says that it compiled correctly

Currently here are my .vscode setup files:tasks.json

{"tasks": [        {"type": "cppbuild","label": "C/C++: g++ générer le fichier actif","command": "/usr/bin/g++","args": ["-fdiagnostics-color=always","-g","${file}","-o","${fileDirname}/${fileBasenameNoExtension}"            ],"options": {"cwd": "${fileDirname}"            },"problemMatcher": ["$gcc"            ],"group": {"kind": "build","isDefault": true            },"detail": "Tâche générée par le débogueur."        }    ],"version": "2.0.0"}

launch.json

{"configurations": [        {"name": "C/C++: g++ Générer et déboguer le fichier actif","type": "cppdbg","request": "launch","program": "${fileDirname}/${fileBasenameNoExtension}","args": [],"stopAtEntry": false,"cwd": "${fileDirname}","environment": [],"externalConsole": false,"MIMode": "gdb","setupCommands": [                {"description": "Activer l'impression en mode Pretty pour gdb","text": "-enable-pretty-printing","ignoreFailures": true                },                {"description": "Définir la version désassemblage sur Intel","text": "-gdb-set disassembly-flavor intel","ignoreFailures": true                }            ],"preLaunchTask": "C/C++: g++ générer le fichier actif","miDebuggerPath": "/usr/bin/gdb"        }    ],"version": "2.0.0"}

I am using VScode with WSL and I have sudo apt-get install build-essential gdb

I have tried several refactoring of these files but they always result in the same.

Especially, when I put "externalConsole": true, in launch.json I do not get any terminal at the end.Hoping the post is complete.

I assume that the [1] + Done is inserted by VScode but why is there "/usr/bin/gdb" --interpreter=mi --tty=${DbgTerm} 0<"/tmp/Microsoft-MIEngine-In-jj3rki1j.avi" 1>"/tmp/Microsoft-MIEngine-Out-k4dxtrne.ao2"


Viewing all articles
Browse latest Browse all 22216

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>