I encountered the following error message when I try to compile using g++ on my macbook terminal
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)
i was wondering if this issue has more to do with my compiler on my macbook terminal?
here's my whole command string, as i typed, with the output messages
1 2 3 4 5 6 7 8 9
(base) MacBook-Air% g++ -o compare comparestring.cpp
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)
(base) MacBook-Air%
See if this helps. I don't know what they are going on about, something about linking to allegro, which I know is an allergy medication. This looks like a different compiler, though, so maybe this is not relevant.
There's main and comp from your code, and some stuff from the runtime support libraries.
You can also try the -v as it suggests. g++ -v -o foo_program foo.cpp
It prints a lot of information about what the compiler is up to.
It might indicate where it's going wrong.