Standard Components Library Not Provided

179

Linking to C++ Libraries

180

Linking with Shared or Archive Libraries

180

Specifying Other Libraries

180

Creating and Using Shared Libraries

180

Compiling for Shared Libraries

180

Example

180

Creating a Shared Library

181

Example

181

Using a Shared Library

181

Example

181

Example of Creating and Using a Shared Library

181

Linking Archive or Shared Libraries

181

Syntax

182

Example

182

Updating a Shared Library

182

Advanced Shared Library Features

182

Forcing the Export of Symbols in main

182

Binding Times

183

Forcing Immediate Binding

183

Side Effects of C++ Shared Libraries

183

Routines and Options to Manage C++ Shared Libraries

183

Linker Options to Manage Shared Libraries

183

Version Control for Shared Libraries

183

Adding New Versions to a Shared Library

184

Standard HP-UX Libraries and Header Files

184

Location of Standard HP-UX Header Files

184

Using Header Files

184

Example

184

Allocation Policies for Containers

184

For -AP Standard Library

184

For -AA Standard Library

185

HP aC++ File Locations

186

HP aC++ Executable Files

186

HP aC++ Runtime Libraries and Header Files

187

10 Mixing C++ with Other Languages

188

Calling Other Languages

188

Data Compatibility between C and C++

188

HP aC++ Calling HP C

189

Using the extern "C" Linkage Specification

189

Syntax of extern "C"

189

Examples of extern "C"

189

Differences in Argument Passing Conventions

190

The main() Function

190

Examples: HP aC++ Calling HP C

190

Running the Example

191

HP C Calling HP aC++

191

Compiling and Running the Sample Programs

192

Calling HP FORTRAN 90 from HP aC++

193

The main() Function

193

Function Naming Conventions

193

Using Reference Variables to Pass Arguments

193

Example of Reference Variables as Arguments

193

Using extern "C" Linkage

194

14 Contents

Page 14
Image 14
HP C/aC++ for PA-RISC Software manual Mixing C++ with Other Languages 188