United States |
|
|
||
Chapter 1
|
demangle [-show_mangled_name][-no_vtable_info][-][file...] |
If no input file is given, or if a minus sign is encountered as an argument (for example, demangle - ), the demangle command reads from the standard input file. The demangle utility supports the processing of 8-bit characters.
- | Read from the standard input file. |
-show_mangled_name | Display encoded name in parentheses after demangled name. |
-no_vtable_info | Suppress the display of information concerning internal symbols (specifically __vtbl and __btbl ). |
demangle file |
This command demangles a file containing Compaq C++ encoded names.
ld main.o foo.o |& demangle |
This command (from the C shell) demangles the output from the linker ( ld ) when linking the main.o and foo.o files.
The C++ Standard Library defines a complete specification of the International C++ Standard, with some differences, as described in the Compaq C++ Release Notes for Tru64 UNIX .
Some of the components in the C++ Standard Library are designed to replace nonstandard components that are currently distributed in the C++ Class Library. However, Compaq will continue to provide the C++ Class Library. Note that on Linux Alpha, the Class Library task package in not supported.
On Tru64 UNIX, the Class Library task package will gradually be retired. Starting with Version 6.3 of the compiler, the task library is no longer distributed in the shared format.
Linking to the Standard Library
When you use the cxx command to compile and link programs that use the C++ Standard Library, no special switches are required. The C++ driver automatically includes the Standard Library run-time support ( -lcxxstd ) on the link command, and automatic template instantiation ( -pt ) is the default mode.
For example, to build a program called prog.cxx that uses the Standard Library, you enter the following command:
cxx prog.cxx |
For detailed information about the Standard Library, refer to Chapter 7.
Reusing code is a cornerstone of object-oriented programming. To minimize the time it takes to develop new applications, a set of reusable classes is an essential part of Compaq C++. Class libraries offer a variety of predefined classes that enable you to work more efficiently.
See the C++ Class Library Reference Manual . for a detailed explanation of the Class Library packages supplied with the compiler. The iostream class library package is from AT&T. See The AT&T C++ Language System, Release 2.0, Library Manual for a description of this package.
Linking to the C++ Class Library
Most of the C++ Class Library packages are automatically included in your program when needed. However, when using the complex package, you must provide the following explicit information for the linker:
-lcomplex -lm |
[Tru64] To use the task package, specify the following when linking using the cxx command:
-threads -ltask |
For example:
cxx thread_program.cxx -threads -ltask |
If you link using the -non_shared option to the cxx command, you must also specify -lcmalib . For example:
cxx -non_shared thread_program.cxx -threads -ltask -lcmalib |
These and other Class Library packages are documented in the C++ Class Library Reference Manual.
The Ladebug Debugger is a source-level debugger that supports Compaq C++. Neither the dbx nor the gdb debugger supports debugging C++ programs. For details on using the Ladebug Debugger, see Chapter 9.
This section contains suggestions for improving build performance when using Compaq C++ on your system.
By default, the compiler compresses object files. This reduces object file size and can result in shortened link times, depending on characteristics of the system and the application. For some large applications, object file compression can significantly slow down the compiler and the linker and can significantly increase the amount of virtual memory required when linking. For some large applications, it is advantageous to compile without object file compression. To do so, specify the -nocompress option on the cxx command.
Partitioning a large application into several shared libraries, which are then linked into an executable, is a useful technique for reducing link times during development. See Chapter 3 for details.
Using precompiled headers can reduce compilation time in environments where
See Chapter 6 for details.
For a description of performance optimization options, see the cxx(1) reference page.
Applications developed using the Compaq C++ compiler require functionality provided in the C++ Run-Time Library. While this run-time library ships with the Tru64 UNIX operating system, newer versions are released with each new version of the compiler. These newer versions provide bug fixes and support for new features in the compiler.
The C++ library redistribution kit gives the user the oportunity to upgrade the C++ library to the most up-to-date libraries without having to upgrade the entire OS and alleviates the need for application developers to include it in their distributions. Because the library is built to be upwardly compatible, a later version of the library works with applications developed by all prior versions of the compiler.
While we strongly recommend upgrading for bug fixes, this is not mandatory. Read the compiler Release Notes to determine whether your application depends on these bug fixes.
Upgrading for new compiler feature support is not optional. To run an application developed using verion n of the compiler, you must use a version of the library that provides support for all its features. In previous versions, this typically results in undefined symbol errors from the loader at runtime. Starting in V6.3, failure to do so will result in the following diagnosic from the loader at runtime:
slab> a.out 333677:a.out: /sbin/loader: Fatal Error: object libcxx.so from liblist in a.out has version "cxx6.3", which does not match the found object: libcxx.so (with version ":V4.0.1") |
The following table provides the version of the library that shipped with each version of the OS. The C++ Compiler Feature Version is the absolute highest version of the compiler with which an application could have been developed and be deployed on this platform without the redistribution kit. An application developed with a newer compiler or that depends on a bug fix requires the installation of the redistribution kit.
OS | Default C++ Library Shipped with System |
Highest Version of C++ Compiler Not Requiring Redistribution Kit |
---|---|---|
4.0D | 6.0-021 | 6.1-031 |
4.0E | 6.0-021 | 6.1-031 |
4.0F | 6.1-031 | 6.1-031 |
4.0G | 6.2-037 | 6.2-040 |
5.0 | 6.2-024 | 6.2-040 |
5.0A | 6.2-037 | 6.2-040 |
5.1 | 6.2-037 | 6.2-040 |
5.1A | 6.3-001 | 6.5-nnn |
NEXT | 6.3-001 | 6.5-nnn |
TBD | 6.5-nnn | 6.5-nnn |
If you are a third-party vendor who is shipping a product based on Version 6.5 or later, you must ensure your that your customers have a V6.3 or later C++ Run-Time Library. To do so, you can direct them to download the latest redistribution kit from the Compaq C++ web site , or you can redistribute it under conditions stated in the Software Product Description .
The mechanism for redistributing the library is for you to provide the file
/usr/lib/cmplrs/cxx/version/CXXREDIST650Vmm.tar |
mm is the revision numbers for this release. This tar file contains a setld kit that installs /usr/lib/cmplrs/cxx/version/libcxx.so and places a symbolic link in /usr/lib/cmplrs/cxx to the latest runtime installed on the system.
To install the kit, follow these steps:
# nm /usr/lib/cmplrs/cxx/libcxx.so | grep libcxx_V __libcxx_V60200002 | 0004396996916008 | G | 0000000000000000 __libcxx_V60200003 | 0004396996916016 | G | 0000000000000000 __libcxx_V60300001 | 0004396996918728 | G | 0000000000000000 __libcxx_V60500001 | 0004396996920176 | G | 0000000000000000 |
# /usr/sbin/setld -i | egrep "CXXLIB|CXXREDIST" | grep install CXXREDIST610 installed Compaq C++ Run-Time Library ... # /usr/sbin/setld -d CXXREDIST610 |
# tar -xvf CXXREDIST650Vmm.tar # /usr/sbin/setld -l CXXREDIST650.kit |
The compiler supports C/C++ OpenMP Version 1.0. C++ exception handling within an OpenMP parallel region is not initially supported but will be supported in a later release. By default, the compiler ignores all C++ OpenMP directives unless you specify the -omp option. For example:
cxx -omp omp_program.cxx |
Previous | Next | Contents | Index |
privacy statement and legal notices |