Does gcc use "LD_LIBARRY_PATH" when doing linking '-L'? <p>I've got libo.a file under current directory, I found I have to use '-L.' to make gcc able to find current directory's archive files.</p> <p>I know under linux/solaris, there's environment variable of "LD_LIBRARY_PATH" to specify shared_library path. I found it doesn't work with gcc when doing link, 'export LD_LIBRARY_PATH' cannot be used to replace '-L.'</p> <blockquote> <p>Question(1) Is this by design of gcc, that linker search path doesn't read from environment variable, but should be specified by command line options?</p> </blockquote> <p>More weird is, I did 'export LIBPATH=.', it doesn't work either, but if I add LIBPATH into a scons file:</p> <pre><code>Library('o.c') Program('n.c',LIBS=['o'],LIBPATH='.') </code></pre> <p>Then it works!</p> <blockquote> <p>Question(2) What is the difference between environment shell variable of 'LIBPATH', and the scons parameter of 'LIBPATH'. Does scons has an internal parameter named 'LIBPATH', which has nothing to do with shell environment?</p> </blockquote> <p>Thanks!</p>