<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2448.0">
<TITLE>RE: [LCP]stdio.h reference</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>> I want to know, how linker reolves the reference for stdio.h. </FONT>
<BR><FONT SIZE=2>> I chekced /etc/fstab file and also checked LD_LIBRARY_PATH. </FONT>
<BR><FONT SIZE=2>> But i didnt get the path for stdio.h.</FONT>
<BR><FONT SIZE=2>> Am I missing something???</FONT>
</P>
<P><FONT SIZE=2>Its path (stdio.h) will be specified by env variables (I can't</FONT>
<BR><FONT SIZE=2>seem to recall the exact ones, but INCLUDE or INCLUDE_PATH</FONT>
<BR><FONT SIZE=2>are probably it). The compiler can also have hardcoded paths</FONT>
<BR><FONT SIZE=2>for system includes (usually /usr/include or /usr/local/include).</FONT>
<BR><FONT SIZE=2>When using gcc like you do, gcc silently instructs the linker</FONT>
<BR><FONT SIZE=2>to link against some libraries, and the libc is one of them.</FONT>
<BR><FONT SIZE=2>If you did "cc -c sample.c && ld sample.o", then it would not</FONT>
<BR><FONT SIZE=2>link. I suppose these libs can vary depending on the compiler</FONT>
<BR><FONT SIZE=2>used.</FONT>
<BR><FONT SIZE=2>LD_LIBRARY_PATH is used to find shared libraries (the .so files)</FONT>
<BR><FONT SIZE=2>which the libc can be compiled into. In any case, the paths</FONT>
<BR><FONT SIZE=2>for include files (such as stdio.h) and libs (used by the</FONT>
<BR><FONT SIZE=2>linker) is different. In your case, it's probably located in</FONT>
<BR><FONT SIZE=2>/usr/lib or /lib, and the compiler is scanning it automagically.</FONT>
</P>
<P><FONT SIZE=2>/etc/fstab has nothing to do with it, btw. It lists the known</FONT>
<BR><FONT SIZE=2>mount points that mount can associate automatically, and their</FONT>
<BR><FONT SIZE=2>mount properties.</FONT>
</P>
<P><FONT SIZE=2>-- </FONT>
<BR><FONT SIZE=2>Vincent Penquerc'h </FONT>
</P>
</BODY>
</HTML>