How can I compile my C source files without needing to put a main function within them?
main
I get an error for the .cfiles that have no main fu
.c
Suppose you have hello.c:
#include #include _start() { exit(my_main()); } int my_main() { printf("Hello"); return 0; }
Compile as:
gcc -nostartfiles hello.c
and you can get an executable out of it.