HP aC++/HP C Programmer's Guide (B3901-90036; A.06.26; September 2011)
Linker Options to Manage Shared Libraries....................................................229
Version Control for Shared Libraries...............................................................229
Adding New Versions to a Shared Library......................................................229
Standard HP-UX Libraries and Header Files.........................................................230
Location of Standard HP-UX Header Files.......................................................230
Using Header Files......................................................................................230
Example................................................................................................230
Allocation Policies for Containers.......................................................................230
For -AP Standard Library..............................................................................230
For -AA Standard Library.............................................................................231
HP aC++ File Locations.........................................................................................233
HP aC++ Executable Files.................................................................................233
HP aC++ Runtime Libraries and Header Files......................................................233
10 Mixing C++ with Other Languages......................................................................................235
Calling Other Languages......................................................................................235
Data Compatibility between C and C++.................................................................236
HP aC++ Calling HP C....................................................................................236
Using the extern "C" Linkage Specification.....................................................236
Syntax of extern "C"....................................................................................237
Examples of extern "C"................................................................................237
Differences in Argument Passing Conventions..................................................237
The main() Function.....................................................................................237
Examples: HP aC++ Calling HP C................................................................238
Running the Example..............................................................................239
HP C Calling HP aC++....................................................................................239
Compiling and Running the Sample Programs................................................241
Calling HP FORTRAN 90 from HP aC++............................................................241
The main() Function.....................................................................................242
Function Naming Conventions......................................................................242
Using Reference Variables to Pass Arguments..................................................242
Example of Reference Variables as Arguments............................................242
Using extern "C" Linkage.............................................................................243
Strings.......................................................................................................243
Arrays.......................................................................................................243
Files in FORTRAN.......................................................................................243
11 Distributing Your C++ Products.............................................................................................244
Applications that use HP aC++ Shared Libraries.......................................................244
Linking Your HP aC++ Libraries with Other Languages..............................................245
Installing your Application.....................................................................................245
HP aC++ Files You May Distribute..........................................................................246
Terms for Distribution of HP aC++ Files....................................................................246
12 Migrating from HP C++ (cfront) to HP aC++..........................................................................247
General Guidelines for Migration...........................................................................247
Contents 17