[users at i-scream] libstatgrab issues on Solaris 10 x64

Scott Severtson ssevertson at digitalmeasures.com
Mon May 21 22:30:59 BST 2012


All,

Based on Tim's suggestion, I added the following to my configure 
command, which works:
LDFLAGS="-lkstat -ldevinfo -lsocket -lnsl"

I'm still concerned/confused that dependent libraries aren't linked by 
default, which appears to be the norm for most other projects I've 
worked with.

Thanks,
--Scott

On 05/21/2012 05:19 PM, Scott Severtson wrote:
> Tim,
>
> Adding the flags as you recommends works, but this isn't what I'd 
> expect when linking to a library. I'd expect the library to know about 
> its own dependencies, not pushing this knowledge to upstream programs.
>
> What can I specify at compile/link time to make libstatgrab.so 
> properly link to these dependencies?
>
> --Scott
>
> On 05/21/2012 05:10 PM, Tim Bishop wrote:
>> Hi Scott,
>>
>> On Mon, May 21, 2012 at 04:53:52PM -0400, Scott Severtson wrote:
>>> And here's the GCC invocation/output:
>>> # gcc -o conftest -O3 -m64 -march=athlon64
>>> -I/apps/collectd-5.1.0/include   -L/apps/collectd-5.1.0/lib -lstatgrab
>>> conftest.c -lstatgrab
>>> Undefined                       first referenced
>>>    symbol                             in file
>>> kstat_data_lookup                   
>>> /apps/collectd-5.1.0/lib/libstatgrab.so
>>> di_devfs_path_free                  
>>> /apps/collectd-5.1.0/lib/libstatgrab.so
>>> kstat_lookup                        
>>> /apps/collectd-5.1.0/lib/libstatgrab.so
>>> di_drv_first_node                   
>>> /apps/collectd-5.1.0/lib/libstatgrab.so
>>> di_drv_next_node                    
>>> /apps/collectd-5.1.0/lib/libstatgrab.so
>>> di_instance                         
>>> /apps/collectd-5.1.0/lib/libstatgrab.so
>>> di_devfs_path                       
>>> /apps/collectd-5.1.0/lib/libstatgrab.so
>>> socket                              
>>> /apps/collectd-5.1.0/lib/libstatgrab.so
>>> kstat_read                          
>>> /apps/collectd-5.1.0/lib/libstatgrab.so
>>> kstat_open                          
>>> /apps/collectd-5.1.0/lib/libstatgrab.so
>>> kstat_close                         
>>> /apps/collectd-5.1.0/lib/libstatgrab.so
>>> di_fini                             
>>> /apps/collectd-5.1.0/lib/libstatgrab.so
>>> di_init                             
>>> /apps/collectd-5.1.0/lib/libstatgrab.so
>>> di_minor_name                       
>>> /apps/collectd-5.1.0/lib/libstatgrab.so
>>> di_minor_next                       
>>> /apps/collectd-5.1.0/lib/libstatgrab.so
>>> ld: fatal: Symbol referencing errors. No output written to conftest
>>> collect2: ld returned 1 exit status
>> Try adding the following to your gcc command:
>>
>> -lkstat -ldevinfo -lsocket -lnsl
>>
>> Tim.
>>




More information about the users mailing list