That error message, undefined symbol: main (referenced by crt1_s.S), means the linker could not find a main() function, which is the required entry point for a standard C or C++ program. When you compile an executable, the system automatically links startup files such as crt1.o, which contain the low-level _start routine that runs before your program begins. That routine expects to call main(), so if it is missing, the linker reports this error.
This usually happens when you compile a source file that does not define main(), such as a utility or library file. For example, running cc math_utils.c without a main() function will cause it. It can also occur if you meant to build a shared library but forgot to add the -shared flag, because the compiler assumes you want an executable by default. Another case is when you compile to an object file with cc -c file.c but then try to link it without including a file that defines main().
To fix it, make sure your project matches what you intend to build. If you want a normal program, one of your files must define int main(void) or int main(int argc, char **argv), and you should compile all sources together with a command like cc main.c other.c -o myprogram. If you are creating a shared library instead, use cc -shared -fPIC -o libmylib.so mycode.c so the linker does not look for main(). In short, this error means the compiler expected to make a runnable program but could not find its starting point.