You should provide output file name after -o option. In your case runexp.o is treated as output file name, not input object file and thus your main function is undefined.
You should provide output file name after -o option. In your case runexp.o is treated as output file name, not input object file and thus your main function is undefined.