Re: [foxboro] data retrieval with legacy historian

Ronny

I find that if I can't rely on the documentation to determine which
libraries
have to be included on the cc commnad line (as sometimes happens),  
I can track them down with a combination of the nm and grep commands.

nm reports the symbols that are defined and/or referenced in a library file.

Let's say for instance that, when you build your application, the linker
reports
that rq_msgs is undefined.

To search for the dynamic library that defines this function
type the following command sequence from a bourne shell script:

cd /usr/lib
for f in lib*.so
do echo $f
nm $f | grep rq_msgs
done

You will see output similar to this:

libhistory.so
[664]   |    137064|     440|FUNC |GLOB |0    |7      |rq_msgs
[397]   |         0|       0|FILE |LOCL |0    |ABS    |rq_msgs50.c

It tells you that rq_msgs in defined in libhistory.so.
Therefore you have to add -lhistory to you compilation command to resolve
that undefined symbol.

If you see the word UNDEF in the second to last field then that library
contains code that calls the function but the fucntion is defined in 
another library file. So you have to keep looking until you find the 
library file where the fucntion IS defined.

This is why you often have to put more than one -lxxx references 
in your compiler command. 
Libraries are built by calling functions from other libraries.

BTW: -lxxx on the compiler command line is short-hand notation
for libxxx.so  or libxxx.a. 
The linker will look for the library file in /usr/lib and in any
other directory specified by the -L flags.

Another usefull trick is to use the ldd command.
If you want to compile for instance an application that retrieves
legacy historian data and you know about an existing program or utility 
that does the same thing, you can use ldd to find out what libraries
the program loads at run-time and where it expects to find them.
Then you know your program will have to be linked also with at least
some of these libraries.


Hope this helps.

Alain Grumelart Ing.
Systems Integration  & IT
Invensys Process Systems 
Foxboro Canada Inc.




-----Original Message-----
From: De Maeyer Ronny [mailto:Ronny.DeMaeyer@xxxxxxxxxx]
Sent: Monday, November 18, 2002 2:51 AM
To: foxboro@xxxxxxxxxxxxx
Subject: [foxboro] data retrieval with legacy historian



Hi,

I am trying to compile a program to retrieve data from the legacy historian.
Following the documentation (BO 193BL rev.e section 8) I use the following
syntax

cc testhist.c -L/opt/fox/hstorian/bin -I/usr/include/fox -lhist -lisam -lfox
-lPW

I get the following errors

ld: fatal: library -lisam : not found
ld: fatal: library -lPW: not found

We use the c compiler from SUN, and the legacy historian on ver. 4.3
In witch library could these files be ?
I have searched the AW but could not find anything like isam.lib or PW.lib

Has anyone any sugestion ?


Thanks in advace,
Ronny

> Ronny De Maeyer
> 
> Fluxys n.v. 
> LNG TERMINAL ZEEBRUGGE
> H.V. Wolvensstraat 3, Kaai 615 
> B - 8380 ZEEBRUGGE
> Tel.: (++32) (0)50 36 66 24 (direct)
> Tel.: (++32) (0)50 36 66 11 (central)
> 
> mailto:ronny.demaeyer@xxxxxxxxxx
> http://www.fluxys.net
> 
> 
> 
> 
**************************************************************************
This e-mail and any attachments thereto may contain information which is
confidential and/or protected by intellectual property rights and are
intended for the sole use of the recipient(s) named above.Any use of the
information contained herein (including, but not limited to, total or
partial reproduction, communication or distribution in any form) by persons
other than the designated recipient(s) is prohibited.Any liability for the
correct and complete transmission of the information or for any delay or
interruption of the transmission or for damages arising from the use of
reliance of the information shall be disclaimed.If you have received this
e-mail in error, please notify the sender either by telephone or by e-mail
and delete the material from any computer.
Thank you for your cooperation
**************************************************************************

 
 
_______________________________________________________________________
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: