This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Compiler fails to find header files.


On 28/11/2007, mofomojo <mofomojo@gmail.com> wrote:
> When I compile any program with GCC, specifying that it is a .c file
> and that I want to compile it as a C-file to produce a binary, I get -
> with any file - something like this :
>
>
>  "*any source file here* :stdio.h: No such file or directory"
>

Hey!

Rule 1: Always post the smallest possible file that gives you the
error. Otherwise we cannot guess what you are doing wrong. And yes,
unless you see the compiler crashing, you should assume that you are
doing something wrong. If it turns out that is the compiler's fault,
then you look humble and prudent. But if you assume it is the
compiler's fault and it turns out it is your own mistake, well, then
you wouldn't look very smart, would you? ;-)

Let's assume your program is hello.c :

#include <stdio.h>
int main()
{
printf("Hello world!\n");
return 0;
}

Can't you compile that program using gcc -c hello.c ?
By the way, the second hit in GCC's manual for "include path" is the
option -v. So also try gcc -v -c hello.c

> I have the libraries installed, and EVEN if I specify the location of
> the file - in a command like -I/usr/lib/include/gcc/i486
> -linux-gnu/4.1.2/include/ssp/ (where the system headers are
> installed)I still get the output ...

What do you mean you have libraries installed? In Ubuntu the relevant
package is libc6-devel. Do you have that package installed?

I seriously doubt the system headers are installed where you say. But
I can't be sure, I use Kubuntu and there they are in
/usr/include/stdio.h. Don't you have a file /usr/include/stdio.h ?

> I have installed, on my system, Debian 4.0 Gnu/Linux with GCC
> installed from the CD provided from the Debian distribution site
> (debian.org ).  I've struggled at this for hours trying to figure what
> is wrong, and I've wasted most of the daylight today trying at this
> which is very valuable to me, seeing as winter is approaching and I
> get very little daylight as is with school and everything :(

I am sorry to hear that. You are right, I think I should go out and
enjoy the sun instead of trying to help you. Moreover, I think we
should just stop developing GCC so we don't waste more daylight. And
we should tell the Debian people to drop everything they are doing:
they seriously need more daylight.

Good luck with that! I hope you figure it out yourself!

Manu.








;-)

I am kidding. Try the things above. I am sure it is some small mistake
(something wrong in the code, some missing package, or some
configuration you inadvertently touched.) You should have asked in a
Debian (or even Ubuntu) user forum or irc channel. Or to someone with
some experience with Debian/Ubuntu. Join your GNU/Linux local user
group. This is not a bug in GCC.

>  this is the summary of the output for what I tried to compile here.
> It failed to produce the binary.
>
>  gcc -g -I/usr/lib/include/gcc/i486-linux-gnu/4.1.2/include/ssp/ -c
> pdf417decode.c
>  pdf417decode.c:39:19: error: stdio.h: No such file or directory
>

This is as useless to us as it is for you. We are not in front of your
computer, we don't know how you installed your system, we don't know
what is in that /usr/lib directory, we don't even know what is inside
of that C file. Really, you have to improve your way of asking
questions. Now, don't jump to the other extreme. The longer your
question, the less likely someone will have time to read it (you know,
other people also want to enjoy the sun). It is a balance between
including enough right information and including too much information.

> P.S. I sent the same help info to the gcc-help@gcc.gnu.org address as
> well and have yet to receive any response after about 3 hours. Thank
> you very much for reading this.

Don't do that. It looks as if you are demanding an answer. Mailing
lists are slow. You cannot send an email and sit down for the answer.
You have to learn to be more patient than that. As I said,
Debian/Ubuntu user forums or IRC channels would have provided you a
quicker solution. Also you must take into account that we are not paid
to answer your questions (actually I am paying this email from my own
money), so demanding puts people off and more likely to just delete
your email. I did it. And then I thought you were probably novice and
clueless but well-intentioned so I recover it from the trash.

I hope you find the solution. Keep us informed!

Cheers,

Manuel.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]