HP Visualize J210XC hp workstations - hp-ux 10.20 graphics administration guid - Page 14
Compiling Starbase Applications, Compiling with Shared Libraries, Examples
View all HP Visualize J210XC manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 14 highlights
Chapter 2: Compiling Your Application This chapter provides information for compiling your application with either archived or shared libraries for the following Application Programming Interfaces (APIs): Starbase, HP-PHIGS, and HP PEX. Compiling examples are given for C, Fortran, and Pascal. The actual pathnames of the conceptual () directory names in this chapter depends on the file system structure. See Chapter 1 for details. Compiling Starbase Applications Compiling with Shared Libraries The compiler programs (cc, f77, and pc) link with Starbase shared libraries by default. Starbase will explicitly load the appropriate device driver library at run time when you compile and link with the shared library /lib/libhpgfx.sl, or use the -lhpgfx option. This loading occurs at gopen(3G) time. Examples Assuming you are using ksh(1), to compile and link a C program for use with the shared library driver, use the forms below. cc example.c -I -L -L -lXwindow \ -lhpgfx -lXhp11 -lX11 -lm -ldld -o example For FORTRAN: fort77 example.f -I -L -L -lXwindow \ -lhpgfx -lXhp11 -lX11 -lm -ldld -o example For Pascal: pc example.p -I -Wl,-L -Wl,-L \ -lXwindow -lhpgfx -lXhp11 -lX11 -lm ldld -o example Compiling with Archive Libraries You can link the appropriate library, for your specific device driver, to a program by using any one of the following: • The path name /.a; • An appropriate relative path name; or • The -ldd option (for example, -lddhcrx) with the LDOPTS environment variable set to -a archive and exported. Or (preferred because of fewer side-effects), "-Wl,a,archive". Page 14 Graphics Administration Guide for HP-UX 10.20