Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using vs code and was writing a simple code to check that everything is fine.

I wrote the following code:

C++
#include<iostream>

using namespace std;

int main()
{
   cout<<"hello world"<<endl;
 return="" 0;
}

and="" i="" am="" getting="" this="" result:

Windows PowerShell
Copyright (C) 2015 Microsoft Corporation. All rights reserved.

PS E:\code practice> cd "e:\code practice\" ; if ($?) { g++ tute 4.cpp -o tute 4 } ; if ($?) { .\tute 4 }
g++.exe: error: tute: No such file or directory
g++.exe: error: 4.cpp: No such file or directory
g++.exe: error: 4: No such file or directory
g++.exe: fatal error: no input files
compilation terminated.
PS E:\code practice


What I have tried:

I tried reopening the vs code.
created a new file and rewrite the code again.
but nothing worked.
Posted
Updated 13-Oct-20 20:45pm
v2

It looks your input filename has blanks.
You should then compile it this way
g++ "tute 4.cpp" -o "tute 4"

Anyway, I suggest you avoiding blanks. E.g. compiling (and running) tute_4.cpp would be simpler
g++ tute_4.cpp -o tute_4
 
Share this answer
 
you should at least correct your code to
C++
return 0;

I personally avoid blanks in directory and file names, because sometimes it leads to trouble.
 
Share this answer
 
Comments
Patrice T 14-Oct-20 2:59am    
On CP, code can get polluted with some = end " while pasting, sometimes.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900