Need Help with Error message on Visual Studio Code

Beginning to Learn C++ in school, Just trying to figure out why my program version is saying this?

I am a student in school and am learning Visual Studio Code because that's the only way to use C++ anyways I put in a basic code and I'm getting this error message. I have included my code and then the error response. Can anyone tell me what went wrong? I feel like it should be all legit...

#include <iostream> using namespace std; int main() { cout << "welcome to C++!"; return 0; }

Error Response Undefined symbols for architecture x86_64: "_main", referenced from: implicit entry/start for main executable ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Visual Studio questions are best asked on the respective Microsoft forums.

#include <iostream>
using namespace std;
int main()
{
  cout << "welcome to C++!";
  return 0;
}

There's nothing wrong with that. (Well, except for the lack of \n in your string.) The error must be with how you are compiling it, i.e. something in the Visual Studio configuration or usage. As MobileTen writes, this forum is not the best place for that discussion; we are mostly Xcode users.

Need Help with Error message on Visual Studio Code
 
 
Q