|03-15-2012, 07:05 PM||#1|
Join Date: Mar 2012
gcc compiler not working
This is my first time on these forums, so I'm not sure if this is the correct place to post this. I'm new to Mac OSX, so I figured I'd post my question here.
I'm using OSX Lion, but I'm having trouble compiling C code. I downloaded Xcode for the gcc compiler, and it's in my $PATH. Then I'll write a simple C program such as:
Then I save it and run the command: gcc -o hello hello.c
Instead of compiling I get this error message:
ld: library not found for -lcrt1.10.6.o
collect2: ld returned 1 exit status
I have no idea what this means or how to fix it. Any help will be greatly appreciated! Thanks!
|03-19-2012, 01:39 PM||#5|
Join Date: Aug 2005
When you install Xcode 4.3, it does not initially install tools for compiling from the command line. Go to Xcode's Downloads preferences and click the Components tab. From there you can install the command line tools. After installing the command line tools, you should be able to compile from the command line.
Author, Xcode Tools Sensei
|Display Modes||Rate This Thread|