[comp.sys.hp] Problem calling AGP graphics from C

saaf@joker.optics.rochester.edu (Lennart Saaf) (01/11/91)

I'm trying to write some code in C that calls the AGP graphics
package. The machine is a 9000/835 running HP-UX 7.0.

Here's a program that illustrates the problem:

#include <stdio.h>   
#include <stdlib.h>   
#include <math.h>
void main()
{
  jbegn();
  jend();
}

cc test.c -lUPLIB
/bin/ld: Unsatisfied symbols:
   FTN_ATAN$ (code)
   FTN_LTOL (code)
   $$divJ (code)
   FTN_S_STOP (code)
   $$remJ (code)

Compilation exited abnormally with code 1 at Thu Jan 10 13:30:13


It seems that I need to link in an additional library, but I can't
find any clues in the docs. And I can't find the unsatisfied symbols
in any /usr/lib/libxxx.a file. I found an include file,
/usr/graphics/c/cagp1.h, but it just aliases the AGP routines.

Any clues would be appreciated.

Len
--
------------------------------------------------------------------------
| Len Saaf, The Institute of Optics, Univ. of Rochester, Rochester, NY |
| Internet: saaf@joker.optics.rochester.edu        Bitnet: SAAF@UOROPT |
------------------------------------------------------------------------

cal@hpfcdq.HP.COM (Cal Selig) (01/12/91)

> I'm trying to write some code in C that calls the AGP graphics
> package. The machine is a 9000/835 running HP-UX 7.0.
> 
> Here's a program that illustrates the problem:
> 
> #include <stdio.h>   
> #include <stdlib.h>   
> #include <math.h>
> void main()
> {
>   jbegn();
>   jend();
> }
> 
> cc test.c -lUPLIB

Part of the problem is that you are missing the C language library libcl.a.

That's only part of the problem though.  In the 7.0 release, an error was
discovered late in the program in the C compiler that also requires adding
two stubs files into the link string when using C.  I believe that the only
place that this problem was talked about (due to time contraints) is in the
README FIRST document for AGP/DGL.  The correct compile line is:

cc test.c -lUPLIB -lcl -lisamstubs -lnlsstubs

Hope this helps.

> 
> Len
> --
> ------------------------------------------------------------------------
> | Len Saaf, The Institute of Optics, Univ. of Rochester, Rochester, NY |
> | Internet: saaf@joker.optics.rochester.edu        Bitnet: SAAF@UOROPT |
> ------------------------------------------------------------------------
> ----------

Cal
--

            /\                              Calvin L. Selig
           /  \                       Graphics Technology Division
          /    \   /\                      Software Engineer
         /vvvvvv\ /  \                       Mail Stop #74
        /  /\    /vvvv\                    hpfcra!cal [SMTP]
       /  /vv\  /      \                cal%hpfcra@hplabs.hp.com
      /  /    \/ /\     \                    (303) 229-4972
     /  /      \/  \/\   \
  __/__/_______/___/__\___\__________________________________________________
    G T D     3404 East Harmony Road  Fort Collins, CO 80525

dhandly@hpcllz2.cup.hp.com (Dennis Handly) (01/12/91)

>/ saaf@joker.optics.rochester.edu (Lennart Saaf) / 10:50 am  Jan 10, 1991 /
>I'm trying to write some code in C that calls the AGP graphics package. 
>The machine is a 9000/835 running HP-UX 7.0.

>cc test.c -lUPLIB
>/bin/ld: Unsatisfied symbols:
>   FTN_ATAN$ (code)   FTN_LTOL (code)   FTN_S_STOP (code)
>   $$divJ (code)      $$remJ (code)

> And I can't find the unsatisfied symbols in any /usr/lib/libxxx.a file.

These symbols, Fortran and Millicode, should be in the following library.
Here is what I get on my machine:

$ what /usr/lib/libcl.a
/usr/lib/libcl.a:
        libcl.a           version A.07.13  08/21/89
$ uname -a
HP-UX hpxxxxx A.B7.00 B 9000/850 hpxxxxx

I don't know why you couldn't find them there, but you will need to add
this library to your cc command.