Code does not run in C on Vscode

Asked

Viewed 611 times

-2

I followed 2 tutorials, installed the Vscode and the compiler Mingw, put all necessary extensions, C/C++ Compiler run, among others. And I put the Mingw path in the PATH of the environment variables. Sometimes the code compiles, sometimes not, but when it compiles, it does not execute. The message that is in the print of the question appears. He says that he is not finding the file, but he is there.inserir a descrição da imagem aqui

Edit: When I run without the ". " it appears here. do you know how to solve? And when I run with the ". " actually appears that it is not supported on my operating system. it is from Linux same.

PS C: Desktop Users Language > test.exe

test.exe : The term 'test.exe' is not recognized as cmdlet name, function, script file or operable program. Check the spelling of the name or, if a path has been included, see if the path is correct and try again. In line:1 character:1 + test.exe + ~~~~~~~~ + Categoryinfo : Objectnotfound: (test.exe:String) [], Commandnotfoundexception + Fullyqualifiederrorid : Commandnotfoundexception

Suggestion [3,General]: The test.exe command was not found, but exists in the current location. By default, Windows Powershell does not load commands from the current location. If you trust this command, type: ". test.exe". See "get-help about_Command_Precedence" for more details.

  • It should not be . /test.exe instead of . /"test,exe" ?

  • Yes, it is . /test.exe I put so and not with comma, with comma gives error

3 answers

0

The ./ works only on linux operating systems. It indicates that we are running the program in the current folder. However, in windows, just run teste.exe being in the application folder.

  • Yes, I used but gave the error I put in the comment below.

0

You can see there in your explorer that there is no file teste.exe. The only executable file is helloWorld.exe

You can run it, being in the directory that your files are, just doing:

helloWorld.exe
  • Yes, I used but gave the error I put in the comment below.

0

He can’t find it, quite possibly because of ./ you need to put in the settings simply your file.exe

  • Yes, I used but gave the error I put in the comment below.

Browser other questions tagged

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