Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6728239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:08:45+00:00 2026-05-26T10:08:45+00:00

After a very long time away from C programming, I’ve decided to try and

  • 0

After a very long time away from C programming, I’ve decided to try and get familiar with it again. I am trying to compile a hello.c program but am having problems. Here’s the code:

#include <stdio.h>
main()
{
  printf("Hello\n");
}

And here’s the output from gcc:

$ gcc -o hello hello.c 
hello.c:1:19: error: stdio.h: No such file or directory
hello.c: In function ‘main’:
hello.c:4: warning: incompatible implicit declaration of built-in function ‘printf’
$

I am working on a Mac running Snow Leopard (10.6.8) and Xcode 3.2.6.

Here’s the ‘gcc -v’ output:

$ gcc -v
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5666.3~6/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)
$

gcc is not able to find stdio.h which is located in /Developer/SDKs/MacOSX10.6.sdk/usr/include. Wondering about how to set an environment variable so I don’t have to specify the include path on the command line. I get another error when I specify it on the command line:

$ gcc -I/Developer/SDKs/MacOSX10.6.sdk/usr/include -o hello hello.c 
ld: library not found for -lcrt1.10.6.o
collect2: ld returned 1 exit status
$

My LD_LIBRARY_PATH environment variable is:

$ echo $LD_LIBRARY_PATH
/Developer/SDKs/MacOSX10.6.sdk/usr/lib
$

Any help is appreciated.

Thanks,
Keith

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T10:08:46+00:00Added an answer on May 26, 2026 at 10:08 am

    You need to re-run the Xcode installer and check the option for UNIX Development:

    enter image description here

    Without this option you can still use Xcode but you will not get /usr/include etc for gcc command-line builds.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After what seems like a very long time trying to find a solution, I
I've been trying for a very long time to get this dialog box to
Unfortunately after very long time i'm re-posting again about the same problem: org.apache.jasper.JasperException: The
After running for a long time, I get more and more holes in the
I am very fresh to asp.net mvc and jQuery. After one day trying, I
I spent a long time learning how to customise WCF from the point of
I need to save a big file, sometime it takes a very long time
I've been using Eclipse and SVN for a very long time now, and this
I noticed a long time ago (when facebook updated their application after the new
For a dataset which takes a very long time to open (it is a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.