United States |
Frequently Asked Questions
|
This collection of frequently asked
questions (FAQ) provides brief answers to
general questions about the C++ compiler product
and to questions of
interest to application developers and other technical users
of the compiler.
Identifiers enclosed in brackets refer to Compaq internal notes
conferences. You might want to cite these identifiers if you need to
contact Compaq Customer Support about a related question.
Questions are followed by an answer (A:); some questions
also have a solution (S:), a workaround (W:),
or both.
Please select
Q1: Which releases of the compilers are currently available? A: Several versions are available, depending on your operating system. For current version and pricing information, call 1.800.AT.COMPAQ (1.800.282.6672) or contact your local business partner. Q2: Are the compilers Year 2000 Ready? A:
Yes. The current versions are ready. For information about
earlier versions, see the Compaq Year 2000 Page.
Q3: Can the C/C++ team keep me
informed about new releases? A: We do not maintain a list of people to
inform. We receive many inquiries on a daily basis and have focused our attention to
responding to these emails. If you'd like to keep informed, the best way is to
visit the Compaq Software
Application Development web site. Q4: Which documentation is available? In
which formats? How can I obtain it? A: The documentation is packaged as part of the
binary kit, and is available in HTML, PostScript, and text format. Once the kit is installed, you can view the HTML documentation by pointing your browser to
the directory/file on the system where the kits are installed: You can obtain a complete hardcopy documentation set by calling 1.800.AT.COMPAQ and requesting item QA-MTRAA-GZ. This kit contains the following documents:
The RBI Letter, Using Compaq C++, and Installation Guide documents are specific to the operating system. Release Notes, Software Product Description, Class Library Reference Manual, Standard Library Stream Input/Output, and Standard Library Locales documents are available only online. Q: Which technical support options are available? A: Various 24x7 technical support
contracts are available. For contract information, call 1.800.AT.COMPAQ. Technical support
on a per-call basis is available at 1.800.354.9000.
Q:
Which elements of the C++ International Standard are not yet supported?
Q:
Does the compiler support precompiled headers?
A:
The compiler supports precompiled headers (PCH) on
Compaq Tru64 UNIX with Compaq C++ Version 6.0 or higher.
Q:
Why doesn't ident, what, or strings work?
A:
If your identification strings are static and not referenced, the
compiler optimizes them away. This breaks tools like
ident, what, and strings, which search for strings
in the executable.
To work around this condition without disabling the optimization, the Version 6.1 compiler
recognizes strings beginning with $RCSfile:,
$ld:, $header:, and @(#)
as being special, so that they are not optimized away.
If the string you want to use does not match one of these patterns,
consider using #pragma ident instead.
Q:
Why does check < int > (d) produce the error message
'Type not followed by "(" in an expression' ?
A:
Explicit specification of function template args is not supported in
the Version 5.n compiler. It is only partially supported in
our latest Version 6.n compiler; that is, the explicit call syntax
works but is not useful because you must use the template argument
somewhere in the function declaration. The compiler cannot support
this feature without a change in the name mangling mechanism, which
would break backward link compatibility (link compatiblity between
object files built with Version 6.n and Version 5.n
compilers).
Q:
Why can't I compile -tall
for the Standard Library?
A:
Because this option instantiates all templates, even those that are not used,
it is not guaranteed to work with the Standard Library.
For example, rb_tree (the underlying implementation of map and set) supports
a bidirectional iterator class. Thus, operator+,
operator-, operator<,
and operator> are not defined in the iterator for that class.
When you instantiate the tree with cxx -tall,
the compiler tries to instantiate recursively everything that is typedef'ed,
even if not used.
Inside rb_tree there is a typedef for
std::reverse_iterator<iterator>, which then instantiates the global
class reverse_iterator with the
rb_tree iterator as the template argument
"RandomAccessIterator" (a misnomer in this case).
This condition causes undefined symbols for these operators, because
the symbols are used within the definition of the operator member functions inside
reverse_iterator.
As a result, the compiler attempts to instantiate them, even though
they do not exist.
Q:
Why does the compiler generate an undefined identifier error for a variable I've
declared on a for loop?
A:
The C++ International Standard has changed the scope rule for variable declared on
a for loop. According to the standard, the scope ends at the end of the
scope of the for loop. Compiling -std arm will give you the old ARM scoping
rules. See Scope of Variables Declared on a for Statement in
Using Compaq C++ for Compaq Tru64 UNIX.
Q:
Why does the compiler generate undefined symbols for functions taking pointer to
functions?
A:
The linkage of the function that is pointed to is now part of the
function type.
From Standard §7.5; Stroustrup §9.2.5:
In a linkage specification, the specified language linkage
applies to the function types of all function declarators,
function names, and variable names introduced by the declaration.
For example:
In the following example, the argument errFunc has C linkage in the
declaration but has C++ linkage in the definition in func.cpp.
As a result, the declaration and definition do not match.
S:
Create a typedef with either C or C++ linkage and use it as
the argument type.
Q:
How do I link C++ with another language?
A:
See Using Compaq C++ with Other
Languages.
One caveat for linking with Fortran is that in many cases Fortran add
a trailing underscore to its external name. The externC
declaration must include this underscore when you define an
external Fortran name. See -assume nounderscore in the Fortran f77
and f90 reference pages.
Q:
Why does the compiler generate undefined symbol WHAT__K9BAD_ALLOCXV?
A:
The library object file bv_inst.o, which
was created incorrectly, contains an undefined symbol bad_alloc::what().
If you #include <vector>,
some inline functions in the bitvector class
(at the bottom of the vector header file) cause the linker to
require references from bv_inst.o.
The unresolved error occurs when the linker includes that object file.
Though disconcerting, the linker error is harmless.
S:
This problem has been fixed in Version 6.n of the Standard Library.
W:
In most cases, you can ignore the linker message.
It is a problem only if a shareable image is being created (because
any application linking against it also receives the warning.
Q:
Why must classes reside in headers for automatic template
instantiation?
A:
This was a limitation in the Version 5.n compilers that has been fixed in
the Version 6.n compilers. For more information about Version 5 template limitations,
see the discussion of templates in your Version 5.n
Using DEC C++ guide.
S:
Upgrade to Version 6.0 or higher.
Q:
Why does the compiler generate duplicate symbol errors when I use automatic instantiation?
A:
This was a limitation in the Version 5.n compilers that has been fixed in
the Version 6.n compilers. For more information about Version 5 template limitations,
see the discussion of templates in your Version 5.n
Using DEC C++ guide.
Note also that you cannot do automatic template instantiation if you defined templates and
non-templates in the same module. This restriction applies because each time
the compiler needs the template implementation, it includes the module
that defines it. If that module contains non-template elements, these also are
defined, and duplicate symbols can be generated.
Consider the following example:
For information about where to place function definitions depending on whether
they are templatized, see
How to Organize Your C++ Code in
Using Compaq C++ for OpenVMS Alpha
Q:
Why am I having trouble with the Standard Library?
A:
When using Standard Library container classes with Compaq C++
Version 6.n, you might receive a message like the following:
The preceding was generated from the following:
The reason for this warning is that internally the container
classes may make calls to Standard Library utilities like pair() which
make use of functional-notation casts. For example pair() makes use of
first(T1()). In this example T1() is a functional-notation cast to type
T1. The type in a functional-notation cast has to be a single type
identifier. Internally the library may add the const qualifier to a
template type to ensure "constness". In the above example this has
happened leading to an instantiation of first (const int()), which
generates a warning.
S:
This problem is corrected in Version 6.1 for Compaq Tru64 UNIX.
W:
Disable the message on the command line. Q:
Because the Standard Library does not ship with the operating system, how can
my customer obtain the library so that my application will link cleanly on his
system?
A:
You can redistribute the library under conditions specified in the
C++ Software Product Description.
For detailed information about how to do so, see Deploying Your
Application in Using Compaq C++ for Tru64 UNIX.
Q:
Why does the compiler generate undefined nullref and
nullref_defined messages?
A:
The headers and the library shipped with the Version 6.0 compiler
were not consistent.
S:
Upgrade to Version 6.1 or higher.
Q:
Why does the compiler receive an internal error, GEM ASSERTION?
A:
This is a Version 6.0 compiler problem. Users of the Version 6.0 compiler
can encounter a GEM ASSERTION on code containing
the expression b ? true : false.
You can search for occurrences in your code by enterting:
S: Upgrade to the latest version. If the problem
persists, please report it to customer support.
Be prepared to supply a preprocessed file along with the
compiler flags that you are using.
Q:
Why does the compiler warn that /usr/include/pdsc.h has nested
comments?
A:
This has been fixed in DIGITAL UNIX 4.0E or later.
If you want to suppress warnings about system headers, use the -SD switch in Version 6.1 or higher. In
earlier versions, protect the headers. See the protect_headers_setup(8) reference page and
the -protect_headers switch in the
cxx(1) reference page.
Q:
Why does the compiler generate warnings from system header files?
A:
You can suppress the warnings by using the -SD switch in Version 6.1 or higher. In
earlier versions, protect the headers. See the protect_headers_setup(8) reference page and
the Q:
Why are my executables bigger in Version 6.1 than in Version 6.0?
A:
One possible reason for an increase in image size
is the introduction of a pre-instantiation library for commonly used
instantiations.
To help speed up links, some commonly used
templates are pre-instantiated and placed in libcxxstd.a.
However, because of the way they are packaged,
if you reference one, you get them all. You
get everything that the templates reference, which is
almost the entire library.
For large, multi-file executables, the size difference shrinks and the
build speedup is significant. However, smaller executables might be
up to about 600K larger.
W:
Remove inst.o and
inst_64.o from the libcxxstd.a and
compile |
|