Jump to content

vscode wont let me run my code

OverclockingNub
Go to solution Solved by Red Nova,
6 minutes ago, OverclockingNub said:

what now?

image.png

#include <iostream>

int main(){
  std::cout << "Hello world";
  
  return 0;
}

 

i keep getting weird errors when i want to run this code, i have code runner and the c/c++ runner installed

 

 

 

Screen Shot 2023-12-24 at 10.57.15 AM.png

Link to comment
Share on other sites

Link to post
Share on other sites

the plugin is trying to compile your file but the name of your file contains a space, so the terminal doesn't know where the file name ends and is unable to find it, not to mention the characters # and <> have meaning in bash and are likely confusing it even more. I don't know why the plugin doesn't use quotation marks around the file name, which would solve this problem, but renaming your file to something sane like "program.cpp" will likely avoid the issue anyway.

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

21 minutes ago, Sauron said:

the plugin is trying to compile your file but the name of your file contains a space, so the terminal doesn't know where the file name ends and is unable to find it, not to mention the characters # and <> have meaning in bash and are likely confusing it even more. I don't know why the plugin doesn't use quotation marks around the file name, which would solve this problem, but renaming your file to something sane like "program.cpp" will likely avoid the issue anyway.

now im getting this error

image.png

Link to comment
Share on other sites

Link to post
Share on other sites

17 minutes ago, OverclockingNub said:

now im getting this error

image.png

Looks like you didn't replace the placeholder text.

 

The file name is "enter program name, for example /home/ubuntu/a.out".

 

You're supposed to remove the part where it says "enter program name..." and replace it with an actual path.

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

8 minutes ago, Red Nova said:
std::cout << "and you missing std namespace";

 

what now?

image.png

Link to comment
Share on other sites

Link to post
Share on other sites

6 minutes ago, OverclockingNub said:

what now?

image.png

#include <iostream>

int main(){
  std::cout << "Hello world";
  
  return 0;
}

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×