[users at i-scream] Problem linking with libstatgrab

Labour, Matthieu (MLPRO SF) matthieu_labour at ml.com
Mon Oct 24 16:13:36 BST 2005


Hi

I downloaded libstatgrab, and compiled it. Everything worked fine. The
examples compiled, linked and they work.

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. 

I would appreciate any help

Thank you

Below is the trace of the compilation/link error

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
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
.obj/vm_stats.o(.text+0xd): In function `main':
/home/mlabour/xd-2.0/common/Admin/AdminServer/src/samples/vm_stats.cpp:4
0: undefined reference to `sg_init()'
.obj/vm_stats.o(.text+0x12):/home/mlabour/xd-2.0/common/Admin/AdminServe
r/src/samples/vm_stats.cpp:43: undefined reference to
`sg_drop_privileges()'
.obj/vm_stats.o(.text+0x35):/home/mlabour/xd-2.0/common/Admin/AdminServe
r/src/samples/vm_stats.cpp:48: undefined reference to
`sg_get_mem_stats()'
.obj/vm_stats.o(.text+0x44):/home/mlabour/xd-2.0/common/Admin/AdminServe
r/src/samples/vm_stats.cpp:48: undefined reference to
`sg_get_swap_stats()'
.obj/vm_stats.o(.text+0x11b):/home/mlabour/xd-2.0/common/Admin/AdminServ
er/src/samples/vm_stats.cpp:65: undefined reference to `sg_get_error()'
.obj/vm_stats.o(.text+0x123):/home/mlabour/xd-2.0/common/Admin/AdminServ
er/src/samples/vm_stats.cpp:65: undefined reference to
`sg_str_error(sg_error)'
collect2: ld returned 1 exit status

OS information:
OS name: Linux
OS release: 2.4.21-27.Elsmp
OS version: #1 SMP Wed Dec 1 21:59:02 EST 2004
Hardware platform: i686
--------------------------------------------------------

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. Click here for important additional terms relating to this e-mail.     http://www.ml.com/email_terms/
--------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.i-scream.org/pipermail/users/attachments/20051024/9cda5215/attachment.html>


More information about the users mailing list