Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
long story short ( as possible ).
professor gave me some code, along with makefiles, and expects me to complete my homework. I ran the makefiles, only to notice that i had not yet install gcc ( smacks for forehead ). So, i apt-get me some gcc. installs just fine. ahem, no errors, no complaints. Try the makefile once again, to no avail. this time its complaining about missing header files. stdio.h, as well as others.
I attempt to compile everyones favorite helloWorld.c to find out if its the profs code, or my machine, only to discover, that i can't even compile helloWorld.c
i get the following errors:
stoopid.c:1:18: error: stdio.h: No such file or directory
stoopid.c: In function ‘main’:
stoopid.c:6: warning: incompatible implicit declaration of built-in function ‘printf’
note: stoopid.c => helloWorld.c
I have located stdio.h, so i know its on my machine, only, not in the /usr/include directory.
it is located here:
koala:/usr/lib/gcc/i486-linux-gnu/4.1.2/include/ssp
i tried copying stdio.h to /usr/include, only to find that it depended on ssp.h
i then realized that just copying the files might not be such a good idea.
I did some searching on google, this forum, and a couple others, and have found similar problems, but nothing close enough to help me.
would it work if i just made a symlink from /usr/include to the other directory?
( ie: the ln -s command )
any other suggestions?
any suggested readings you might be able to offer?
( i tried man gcc and gcc --help with no luck )
thanks ya'll.
ahh yes, the specifics:
debian etch 2.6.18-3-486
gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
and when i issued the command: gcc -v
it spit all this out at me:
koala:/usr/lib/gcc/i486-linux-gnu/4.1.2/include/ssp# gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --with-tune=i686 --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
Last edited by spargonaut; 02-14-2007 at 02:31 PM.
in the mean time, i have discovered that installing the 'build-essentials' package cleared up the stdio.h: not found problem, but i have since run into another problem, this one more specific to the code that i'm trying to compile, ahem, make.
( specifically, its complaining about the -lXaw flag being used with the gcc command in the make file ).
unfortunately, i fear that getting that resolved consists of me getting much more familiar with gcc, getting help from my instructor, more toiling and reading, and every combination thereof.
thanks for the feedback!
( btw, if anyone can explain what the -lXaw flag does with gcc, it would be greatly appreciated. thx! )
if you still have troubles you have to give us exact copy paste commands you use and output you get.
even give us exact copy paste code/makefile whatever you are using.
yea you are right sorry.
apon further reflection something is wrong with your glibc installation.
perhaps you don't have glibc developement files.
some linux distributions actually put some glibc files into a glibc-headers package.
in the mean time, i have discovered that installing the 'build-essentials' package cleared up the stdio.h: not found problem, but i have since run into another problem, this one more specific to the code that i'm trying to compile, ahem, make.
( specifically, its complaining about the -lXaw flag being used with the gcc command in the make file ).
( btw, if anyone can explain what the -lXaw flag does with gcc, it would be greatly appreciated. thx! )
Any flags passed to gcc that start with a lowercase l indicate the following token is the name of a library stripped of the “lib” prefix (e.g., to link your app to libcurses, you should pass the flag “-lcurses”). These flags are actually carried over when gcc executes ld after compilation. So “-lXaw” means that your app should link against libXaw, which (in case you don’t know) is the X athena widget library. So, you probably need to install the “X development” package or something. Perhaps it already is on your system, but ld cannot find it. In this case, there are many possibilities, and no sure method to solve your problem without more information. There must be literature somewhere explaining the unix library system in further detail.
P.S.
Did you know there is a library named “libiberty” (that way, when linking, you specify the flag “-liberty”).
osor, you hit the nail on the head!
last night, my instructor gave pretty much the same answer and explanation you did.
thank you very much for explaining that to a newb.
the X development package was exactly what i needed. ( xorg.dev )
once i got that installed, everything worked perfectly.
also, i had no clue what Xaw stood for, nor what it did.
now i've got some research to do, looking up that library, as well as the iberty library.
thanks a ton for the help!
and thanks to everyone else who made suggestions.
hello ,
i read your posts quickly ... i don't see any reason to link or need any development tools in your machine , if you have gcc installed , since in order to use stdio library you only need to include it's header in your code and there is no need in linkage which is not the case in math library for example ...
i have a question ..
is the line including the stdio.h written like this :
#include <stdio.h>
or like this :
#include "stdio.h"
in the first case , it will search it in all paths exists in your PATH ENVIROMENT
in the second case it will search it in the ./ , which is this directory .
p.s : what editor you use ?? i would suggest you use emacs to code and the shell to run and compile ...!
good luck and enjoy the c/cpp programming languages !!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.