HP aC++/HP C A.06.20 Programmer's Guide
-exec
-exec
The -exec option indicates that any object file created will be used to create an
executable file. Constants with a protected or hidden export class are placed in the
read-only data section. This option also implies -Bprotected_def. It makes all
defined functions and data (even tentatively defined data) protected by default (unless
otherwise specified by another binding option or pragma).
-lname
-lname
The name value forms part of the name of a library the linker searches for when looking
for routines called by your program.
The -lname option causes the linker to search one of the following default libraries,
if they exist, in an attempt to resolve unresolved external references:
• /usr/lib/lib/hpux32/name.so
• /usr/lib/lib/hpux32/name.a
• /opt/langtools/lib/hpux32lib/name.so
• /opt/langtools/lib/hpux64lib/name.a
Whether it searches the shared library (.so) or the archive library (.a) depends on the
value of the -a linker option or the -minshared compiler option.
NOTE: Because a library is searched when its name is encountered, placement of a
-l is significant. If a file contains an unresolved external reference, the library containing
the definition must be placed after the file on the command line. For details refer to the
description of ld in the HP-UX Reference Manual or the ld(1) manpage if it is installed
on your system.
Example:
aCC file.o -lnumeric
This command directs the linker to link file.o and (by default) search the library
/usr/lib/hpux32/libnumeric.so.
-L directory
-L directory
The directory parameter is the HP-UX directory where you want the linker to search
for libraries your program uses before searching the default directories.
The -L directory option causes the linker to search for libraries in directory in
addition to using the default search path.
See -lname option for default search path.
Library Options 61