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

Reply
1 reply

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

C error: ld: library not found for -lgcc collect2: error: ld returned 1 exit status

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.