I keep on getting this error compiling with gcc on Ubuntu: ld: error in main.o(.eh_frame); no .eh_frame_hdr table will be created.

No matter the program I try compiling, I get the same message. What am I doing wrong?