Vscode compiles and debugs but does not execute C programs

Asked

Viewed 26 times

0

After configuring Visual Studio Code to compile and debug C, I am unable to run the code. A . exe that works properly, but for reasons of practicality, I wish the output and input of data to be performed in the same IDE itself.

Having executed any code, be a simple Hello World or some more complex exercise, the following information is printed on the guide Debug Console:

=thread-group-added,id="i1"
GNU gdb (GDB) 7.6.1
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Warning: Debuggee TargetArchitecture not detected, assuming x86_64.
=cmd-param-changed,param="pagination",value="off"
=cmd-param-changed,param="args",value="2>CON 1>CON <CON"
[New Thread 12368.0x3790]
[New Thread 12368.0x19c]
Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Symbols loaded.
Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Symbols loaded.
Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Symbols loaded.
Olá mundo!=thread-exited,id="2",group-id="i1"
The program 'c:\projetos\algoritmos_e_programacao\olamundo.exe' has exited with code 0 (0x00000000).

And these in the guide Terminal:

Windows PowerShell
Copyright (C) Microsoft Corporation. Todos os direitos reservados.

Experimente a nova plataforma cruzada PowerShell https://aka.ms/pscore6

PS C:\projetos\algoritmos_e_programacao>  & 'c:\Users\Bernardo\.vscode\extensions\ms-vscode.cpptools-1.5.0-insiders\debugAdapters\bin\WindowsDebugLauncher.exe' '--stdin=Microsoft-MIEngine-In-emlhiuzs.4rj' '--stdout=Microsoft-MIEngine-Out-mvusyukr.bmb' '--stderr=Microsoft-MIEngine-Error-4k0ofz0q.tnm' '--pid=Microsoft-MIEngine-Pid-n01hqbbo.svl' '--dbgExe=C:\MinGW\bin\gdb.exe' '--interpreter=mi'
PS C:\projetos\algoritmos_e_programacao>

After that, the execution is terminated without being able to visualize any impression of printf() or without any data entry from scanf() has been requested. So far, I have used the Run Code extension, but it limits debugging a lot and therefore no longer serves me much.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.