[LCP]stdio.h reference

Vincent Penquerc'h Vincent.Penquerch at artworks.co.uk
Mon Jan 7 23:11:51 UTC 2002


> I want to know, how linker reolves the reference for stdio.h. 
> I chekced /etc/fstab file and also checked LD_LIBRARY_PATH. 
> But i didnt get the path for stdio.h.
> Am I missing something???

Its path (stdio.h) will be specified by env variables (I can't
seem to recall the exact ones, but INCLUDE or INCLUDE_PATH
are probably it). The compiler can also have hardcoded paths
for system includes (usually /usr/include or /usr/local/include).
When using gcc like you do, gcc silently instructs the linker
to link against some libraries, and the libc is one of them.
If you did "cc -c sample.c && ld sample.o", then it would not
link. I suppose these libs can vary depending on the compiler
used.
LD_LIBRARY_PATH is used to find shared libraries (the .so files)
which the libc can be compiled into. In any case, the paths
for include files (such as stdio.h) and libs (used by the
linker) is different. In your case, it's probably located in
/usr/lib or /lib, and the compiler is scanning it automagically.

/etc/fstab has nothing to do with it, btw. It lists the known
mount points that mount can associate automatically, and their
mount properties.

-- 
Vincent Penquerc'h 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.linux.org.au/pipermail/linuxcprogramming/attachments/20020107/9e087fc4/attachment.htm 


More information about the linuxCprogramming mailing list