|
|
#1 |
|
Prospect
Join Date: Mar 2012
Posts: 2
|
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: #include <stdio.h> int main() { printf("Hello World!\n"); return 0; } 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! |
|
|
|
|
|
#2 |
|
MVP
Join Date: Apr 2004
Location: Cumbria, UK
Posts: 2,461
|
Which version of XCode have you downloaded?
|
|
|
|
|
|
#3 |
|
MVP
Join Date: May 2004
Posts: 2,012
|
This looks like you have a rogue compiler flag somehwere in your environment. What's the output of: env | grep 'lcrt1.10.6.o'
|
|
|
|
|
|
#4 | |||||||||||||||||||||||
|
Prospect
Join Date: Mar 2012
Posts: 2
|
I downloaded 4.3.1. |
|||||||||||||||||||||||
|
|
|
|
|
#5 |
|
Prospect
Join Date: Aug 2005
Posts: 45
|
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.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|