Q: C error: ld: library not found for -lgcc collect2: error: ld returned 1 exit status
I am trying to compile the basic "Hello World" C code with gcc but the following error appears:
ld: library not found for -lgcc
collect2: error: ld returned 1 exit status
The code itself it's fine, ran it in another computer without any problems.
First installed gcc manually, had the problem, then uninstalled and installed it with homebrew and still have the problem. How can I fix this?
(Have the 5.1.0 version of gcc)
MacBook Pro (13-inch Mid 2012)
Posted on Sep 26, 2016 9:35 PM
Ok so no one answered but I found a solution. It's the version of gcc, apparently newer versions have that bug, the one that works and compiles the codes is the 4.9 version, in case it's useful to someone.
Posted on Sep 27, 2016 8:58 PM