ld: library not found for -lgcc
I'm not sure with it's like this, but if I compile with gcc-4.9 (as the gcc version I have instaled is version 4.9.2) instead of gcc it works as it should. So the compilation sentence that seems to work is gcc-4.9 -o exec_name program.c. If someone knows why it is like this I would be interested to know.