I have tried using the library path in the LD_LIBRARY_PATH and also using the -L option in the Makefile. Can you suggest me something for this. Jonathan Wakely-4 wrote: > > On 11 August 2011 12:36, manaankit2 wrote: >> >> Hello, >> >> I have a c file which uses the function defined in a library. In my >> makefile >> i am providing the -lCOM option with gcc. Where COM is the library. The >> Library Path is there in the LD_LIBRARY_PATH. >> >> But when i run the gmake, i get the error which says that undefined >> Object >> reference. >> That function is there in the COM lib(libCOM.a). >> >> Can someone help me with the same? > > This is not really a gcc question, it's about your linker. > > On some platforms (e.g. Solaris) the linker will look in > LD_LIBRARY_PATH, on others (e.g. GNU/Linux) it won't and you need to > use -L to specify the directory containing libCOM.a > > -- View this message in context: http://old.nabble.com/GCC-undefined-object-reference-tp32241304p32247042.html Sent from the gcc - Help mailing list archive at Nabble.com.