<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-16">

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-16">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.0.6603.0">
<TITLE>Problem linking with libstatgrab</TITLE>
</HEAD>
<BODY >
<DIV>
<!-- Converted from text/rtf format -->

<P><FONT SIZE=2 FACE="Arial">Hi</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">I downloaded libstatgrab, and compiled it. Everything worked fine. The examples compiled, linked and they work.</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">I tried to link one of the example with the GNU makefile that I use for my application and I get undefined reference error. However libstatgrab is in my LD_LIBRARY_PATH. I must be doing something wrong. </FONT></P>

<P><FONT SIZE=2 FACE="Arial">I would appreciate any help</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">Thank you</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">Below is the trace of the compilation/link error</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">g++ -W -Wall -Wpointer-arith -O3 -g -pipe    -D_REENTRANT -DACE_HAS_AIO_CALLS -D_GNU_SOURCE  -I/home/mlabour/xd-2.0 -I/home/mlabour/mlems/mlems-0.3.1/include -I/opt/tibco/ems/clients/c/include -I/projects/xdirect/thirdparty/boost/include/boost-1_32 -I/projects/xdirect/thirdparty/log4cxx/include -I/home/mlabour/tibrv/include -I/projects/xdirect/thirdparty/libstatgrab-0.12/include -I/projects/xdirect/thirdparty/ACE_wrappers -DACE_HAS_EXCEPTIONS -D__ACE_INLINE__  -c -o .obj/vm_stats.o vm_stats.cpp</FONT></P>

<P><FONT SIZE=2 FACE="Arial">g++ -W -Wall -Wpointer-arith -O3 -g -pipe    -D_REENTRANT -DACE_HAS_AIO_CALLS -D_GNU_SOURCE  -I/home/mlabour/xd-2.0 -I/home/mlabour/mlems/mlems-0.3.1/include -I/opt/tibco/ems/clients/c/include -I/projects/xdirect/thirdparty/boost/include/boost-1_32 -I/projects/xdirect/thirdparty/log4cxx/include -I/home/mlabour/tibrv/include -I/projects/xdirect/thirdparty/libstatgrab-0.12/include -I/projects/xdirect/thirdparty/ACE_wrappers -DACE_HAS_EXCEPTIONS -D__ACE_INLINE__  -L/home/mlabour/xd-2.0/lib/LINUX-2.4 -L/home/mlabour/mlems/mlems-0.3.1/lib -L/opt/tibco/ems/clients/c/lib -L/projects/xdirect/thirdparty/log4cxx/lib -L/projects/xdirect/thirdparty/boost/lib -L/home/mlabour/tibrv/lib -L/projects/xdirect/thirdparty/libstatgrab-0.12/lib -Wl,-E -L/projects/xdirect/thirdparty/ACE_wrappers/ace -L./ -o vm_stats .obj/vm_stats.o  -lACE -lAdminServer -lboost_thread-gcc-mt-d-1_32 -lboost_date_time-gcc-mt-d-1_32 -lstatgrab -ldl -lpthread -lrt</FONT></P>

<P><FONT SIZE=2 FACE="Arial">.obj/vm_stats.o(.text+0xd): In function `main':</FONT>

<BR><FONT SIZE=2 FACE="Arial">/home/mlabour/xd-2.0/common/Admin/AdminServer/src/samples/vm_stats.cpp:40: undefined reference to `sg_init()'</FONT>

<BR><FONT SIZE=2 FACE="Arial">.obj/vm_stats.o(.text+0x12):/home/mlabour/xd-2.0/common/Admin/AdminServer/src/samples/vm_stats.cpp:43: undefined reference to `sg_drop_privileges()'</FONT></P>

<P><FONT SIZE=2 FACE="Arial">.obj/vm_stats.o(.text+0x35):/home/mlabour/xd-2.0/common/Admin/AdminServer/src/samples/vm_stats.cpp:48: undefined reference to `sg_get_mem_stats()'</FONT></P>

<P><FONT SIZE=2 FACE="Arial">.obj/vm_stats.o(.text+0x44):/home/mlabour/xd-2.0/common/Admin/AdminServer/src/samples/vm_stats.cpp:48: undefined reference to `sg_get_swap_stats()'</FONT></P>

<P><FONT SIZE=2 FACE="Arial">.obj/vm_stats.o(.text+0x11b):/home/mlabour/xd-2.0/common/Admin/AdminServer/src/samples/vm_stats.cpp:65: undefined reference to `sg_get_error()'</FONT></P>

<P><FONT SIZE=2 FACE="Arial">.obj/vm_stats.o(.text+0x123):/home/mlabour/xd-2.0/common/Admin/AdminServer/src/samples/vm_stats.cpp:65: undefined reference to `sg_str_error(sg_error)'</FONT></P>

<P><FONT SIZE=2 FACE="Arial">collect2: ld returned 1 exit status</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">OS information:</FONT>

<BR><FONT SIZE=2 FACE="Arial">OS name: Linux</FONT>

<BR><FONT SIZE=2 FACE="Arial">OS release: 2.4.21-27.Elsmp</FONT>

<BR><FONT SIZE=2 FACE="Arial">OS version: #1 SMP Wed Dec 1 21:59:02 EST 2004</FONT>

<BR><FONT SIZE=2 FACE="Arial">Hardware platform: i686</FONT>
</P>

</DIV>
<DIV>
<HR COLOR="gray">
</DIV>
<DIV>If you are not an intended recipient of this e-mail, please notify the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute it. <A HREF="http://www.ml.com/email_terms/">Click here </A>for important additional terms relating to this e-mail.     <A HREF="http://www.ml.com/email_terms/">http://www.ml.com/email_terms/</A></DIV>
<DIV>
<HR COLOR="gray">
</DIV></BODY></HTML>