Find the answer to your Linux question:
Results 1 to 5 of 5
Hello, I'm using Slackware 12.1. When I try to compile simple 'hello world' app with gcc I get error message: "stdio.h : No such file or directory..." I guess thath ...
  1. #1
    Just Joined!
    Join Date
    Aug 2008
    Posts
    5

    c/c++ include files

    Hello, I'm using Slackware 12.1. When I try to compile simple 'hello world' app with gcc I get error message:
    "stdio.h : No such file or directory..."

    I guess thath I need to set something in envoirment variables, but I'm not sure what.Thanks in advance for help.

    ps. there are all needed packages.

  2. #2
    Linux Enthusiast gerard4143's Avatar
    Join Date
    Dec 2007
    Location
    Canada, Prince Edward Island
    Posts
    714
    Could you show us your compile line i.e. gcc test.c -o test

    and does the stdio.h file exist on your machine?

  3. #3
    Just Joined!
    Join Date
    Aug 2008
    Posts
    5
    ofcourse, there is everything I need to compile that program, but I suppose I need to specify path to 'includes' folder or something like that.
    Here's my output:

    Code:
    #gcc main.c
    main.c:1:19: error: stdio.h: No such file or directory
    main.c: In function 'main':
    main.c:5: warning: incompatible implict declaration of built-in function 'printf'

    Thath is hello world, so there is no option of wrong source code. It's all because compiler can't find header file stdio.h. And ofcourse there's same problem with any basic library.

  4. #4
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    Are you sure that have the headers installed? What does this command say:
    Code:
    ls /usr/include/stdio.h
    ?
    DISTRO=Arch
    Registered Linux User #388732

  5. #5
    Linux Guru techieMoe's Avatar
    Join Date
    Aug 2004
    Location
    Texas
    Posts
    9,496
    Quote Originally Posted by msz.abc View Post
    Thath is hello world, so there is no option of wrong source code.
    Actually, you'd be surprised how many variants of Hello, World I've seen, all of them wrong. Please do post your source code regardless. It could be something as simple as a missing semicolon.
    Registered Linux user #270181
    TechieMoe's Tech Rants

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...