Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP Itanium-based Systems: HP aC++/HP C Programmer's Guide > Chapter 1 Getting Started with HP aC++

Files on the aCC Command Line

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

Files containing source or object code to be compiled or linked by HP aC++ can be any of these files:

Unless you use the -o option to specify otherwise, all files that the aCC compiling system generates are put in the working directory, even if the source files are from other directories.

C++ Source File (.C file)

You must name the HP aC++ source files with extensions beginning with either .c or .C, possibly followed by additional characters. If you compile only, for example by using -c, each C++ source file produces an object file with the same file name prefix as the source file and a .o file name suffix.

However, if you compile and link a single source file into an executable program in one step, the .o file is automatically deleted, unless -g is used without +noobjdebug.

NOTE: HP recommends that your source files have .c or .C extensions only, without any additional characters. While extensions other these are permitted for portability from other systems, they may not be supported by HP tools and environments.

Preprocessed Source Files (.i Files)

Files with .i extensions are assumed to be preprocessor output files. These files are processed in the same way as .c or .C files, except that the preprocessor is not run on the .i file before the file is compiled.

Use the -P or the -E compiler option to preprocess a C++ source file without compiling it.

Assembly Language Source Files (.s Files)

Files with names ending in .s are assumed to be assembly source files. The compiler invokes the assembler through cc to create .o files from these.

Use the -S option to compile a C++ source file to assembly code and put the assembly code into a .s file.

Object Files (.o Files)

Files with .o extensions are assumed to be relocatable object files that have to be included in the linking. The compiler invokes the linker to link the object files and create an executable file.

Use the -c option to compile a C++ source file into a .o file.

Library Files (.a and .so Files)

Files ending with .a are assumed to be archive libraries. Files ending with .so are assumed to be shared libraries.

Use the -c and +z options to create object files of Position-Independent Code (PIC) and the -b option to create a shared library.

Use the -c option to create object files and the ar command to combine the object files into an archive library.

Configuration Files (.conf Files)

You can configure compiler options on a system-wide basis. The compiler reads the configuration files:

/var/aCC/share/aCC.conf (aC++), or

/var/ansic/share/cc.conf (ANSI C), if present.

In C-mode, the configuration file defaults to /var/ansic/share/cc.conf, unless overridden by the environment variable CC_CONFIG..

In C++ mode, the config file defaults to /var/aCC/share/aCC.conf, unless overriden by the environment variable CXX_CONFIG.

The options in the configuration file can be specified in the same manner as that for CCOPTS and CXXOPTS, namely:

[options-list-1] [|[options-list-2]]

where options in options-list-1 are applied before the options in the command line, and options in options-list-2 are applied after the options in the command line.

The final option ordering would be:

<file-options-1><envvar-options-1><command-line-options>

<envvar-options-2><file-options-2>

NOTE: No configuration files are shipped along with aC++, but can be installed by the system administrator, if required.

The config file options before the "|" character set the defaults for compilations, and the options after the character override the user’s command line settings.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.