Re: [foxboro] cc compiler library linking errors

Hi Chuck,

-lposix4 was definitely missing.

Here is a simple little script to find missing libraries. 
Unix utility "nm" lists the internal names and external references for object 
(*.o), static link libraries (*.a) and shared object libraries (*.so)

Run something like the following quickie hack to hunt for undefined symbols in 
/usr/lib:

        cd /usr/lib
        for f in *.so*
        {
        echo $f
        nm $lf | egrep "timer_create|sigwaitinfo|timer_settime"
        }

Output from the hack on AW5x 6.x produces something like (... skips over 
irrelevant stuff)

ld.so.1
....
libbsm.so.1
libc.so
[3121]  |    223452|      56|FUNC |GLOB |0    |9      |__timer_create
[3335]  |    223676|      56|FUNC |GLOB |0    |9      |__timer_settime
libc.so.1
[3121]  |    223452|      56|FUNC |GLOB |0    |9      |__timer_create
[3335]  |    223676|      56|FUNC |GLOB |0    |9      |__timer_settime
libc2.so
...
libfox.so
[748]   |         0|       0|NOTY |GLOB |0    |UNDEF  |sigwaitinfo
[705]   |         0|       0|NOTY |GLOB |0    |UNDEF  |timer_create
[880]   |         0|       0|NOTY |GLOB |0    |UNDEF  |timer_settime
libfox.so.61
[744]   |         0|       0|NOTY |GLOB |0    |UNDEF  |sigwaitinfo
[702]   |         0|       0|NOTY |GLOB |0    |UNDEF  |timer_create
[876]   |         0|       0|NOTY |GLOB |0    |UNDEF  |timer_settime
libfoxapi.so
...
libposix4.so
[98]    |         0|       0|NOTY |GLOB |0    |UNDEF  |__timer_create
[106]   |         0|       0|NOTY |GLOB |0    |UNDEF  |__timer_settime
[122]   |      5844|      16|FUNC |GLOB |0    |5      |_sigwaitinfo
[45]    |      4648|      12|FUNC |GLOB |0    |5      |_timer_create
[67]    |      4696|      12|FUNC |GLOB |0    |5      |_timer_settime
[87]    |      5844|      16|FUNC |WEAK |0    |5      |sigwaitinfo
[76]    |      4648|      12|FUNC |WEAK |0    |5      |timer_create
[111]   |      4696|      12|FUNC |WEAK |0    |5      |timer_settime
libposix4.so.1
[98]    |         0|       0|NOTY |GLOB |0    |UNDEF  |__timer_create
[106]   |         0|       0|NOTY |GLOB |0    |UNDEF  |__timer_settime
[122]   |      5844|      16|FUNC |GLOB |0    |5      |_sigwaitinfo
[45]    |      4648|      12|FUNC |GLOB |0    |5      |_timer_create
[67]    |      4696|      12|FUNC |GLOB |0    |5      |_timer_settime
[87]    |      5844|      16|FUNC |WEAK |0    |5      |sigwaitinfo
[76]    |      4648|      12|FUNC |WEAK |0    |5      |timer_create
[111]   |      4696|      12|FUNC |WEAK |0    |5      |timer_settime
libppcfg50.so
....

Script can be improved to skip symbolic links, add *.a, reduce nm output etc.

Joachim Hirche
CIM Concepts Inc.
200 Continental Drive Ste 112  Newark  DE  19713  USA
302 368 8982 x111
mailto:Joachim.Hirche@xxxxxxxxxxxxxxx


-----Original Message-----
From: Murray, Steve [mailto:SMurray@xxxxxxxxxx]
Sent: Tuesday, July 22, 2003 18:40
To: 'foxboro@xxxxxxxxxxxxx'
Subject: Re: [foxboro] cc compiler library linking errors




Hi Chuck,

  Try adding the -lposix4
  This is all I have to do for my latest program - IA version 6.1

cc X.c -o X -lfox -lposix4

  I am not doing anything fancy either .  .  .

Steve Murray
Asarco

-----Original Message-----
From: Jones, Charles R. (Chuck) [mailto:CRJones@xxxxxxxx]
Sent: Tuesday, July 22, 2003 15:38
To: foxboro@xxxxxxxxxxxxx
Subject: [foxboro] cc compiler library linking errors


Are there any C programmers still out there?  I'm having trouble with the
Fox libraries when I compile my program.  I use the form:

cc filename.c -o filename -lfox -lnsl -lsocket

The program gathers bits of information from several blocks and prints the
data out in a report.  All I needed to do was to add one more line
containing one more number to the report.  The C code was embarrassingly
simple and I'm certain that it is not the code, especially since the error
messages tell me so:  

Undefined symbol                first referenced in file
timer_create            /usr/lib/libfox.so
sigwaitinfo                     /usr/lib/libfox.so
timer_settime           /usr/lib/libfox.so
ld: fatal: Symbol referencing errors. No output written

The file -- libfox.so -- is an ELF 32-bit MSB dynamic lib SPARC Version 1,
etc  -- according to the file command.  So, I can't just scan through it for
clues using the vi editor. 

Really, I've done this before.  It's just that I can't recall doing it since
the update to the operating system back in late 1999 (remember the Y2K
hoax?).  I'm open to suggestion from anyone familiar with this type of
scenario.  My current guess is that some of the subsequent library files
have been moved from their former locations.

Chuck Jones
Refinery Automation Technologist
Tate & Lyle North America -- Lafayette South Plant
765.477.5324 - Office  | 877.536.9219 - Pager

*

This e-mail and any files transmitted with it are the property of Americas 
Mining Corporation and/or its affiliates, are confidential, and are intended 
solely for the use of 
the individual or entity to whom this e-mail is addressed. If you are not a 
named recipient or otherwise have reason to believe that you have received this 
message in error, 
please notify the sender and delete this message immediately from your 
computer. Any other use, retention, dissemination forwarding, printing or 
copying of this e-mail is 
strictly prohibited.  Although this email and any attachments are believed to 
be free of any virus or other defect that might affect any computer system into 
which it is 
received, and opened, it is the responsibility of the recipient to ensure that 
it is virus free and no responsibility is accepted by Americas Mining 
Corporation and/or its 
affiliates for any loss or damage arising in any way from its use

This e-mail has been scanned and cleared by MailMarshal 
www.marshalsoftware.com

*
 
 
_______________________________________________________________________
This mailing list is neither sponsored nor endorsed by Invensys Process
Systems (formerly The Foxboro Company). Use the info you obtain here at
your own risks. Read http://www.thecassandraproject.org/disclaimer.html
 
foxboro mailing list:             http://www.freelists.org/list/foxboro
to subscribe:         mailto:foxboro-request@xxxxxxxxxxxxx?subject=join
to unsubscribe:      mailto:foxboro-request@xxxxxxxxxxxxx?subject=leave
 
 
 
_______________________________________________________________________
This mailing list is neither sponsored nor endorsed by Invensys Process
Systems (formerly The Foxboro Company). Use the info you obtain here at
your own risks. Read http://www.thecassandraproject.org/disclaimer.html
 
foxboro mailing list:             http://www.freelists.org/list/foxboro
to subscribe:         mailto:foxboro-request@xxxxxxxxxxxxx?subject=join
to unsubscribe:      mailto:foxboro-request@xxxxxxxxxxxxx?subject=leave
 

Other related posts: