I am trying to set up C++ on my apple silicon laptop and am running into some trouble. I am using VSCode and downloaded the C/C++ extension as well as code runner--I am now trying to simply print "hello world" but am running into trouble as I keep getting this error
[Running] cd "/Users/samdisorbo/Documents/code/C++/" && g++ learning.cpp -o learning && "/Users/samdisorbo/Documents/code/C++/"learning
Undefined symbols for architecture arm64:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
[Done] exited with code=1 in 0.075 seconds
I don't think it has anything to do with my code, so it must be an installation error right? I checked and clang and clang++ are both on my laptop...
here is my code
# include <iostream>
using namespace std;
int main(){
printf("Hello World");
return 0;
}
main();