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
SCTP Programmer's Guide: HP-UX 11i v2, HP-UX 11i v3 > Chapter 3 Compiling and Running Applications that Use the SCTP Socket APIs

Compiling Applications that Use the SCTP APIs

» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

Before compiling an application, ensure the following:

  • The SCTP product is installed in your system. The SCTP product is available for download at:

    http://www.software.hp.com

  • The XOPEN_SOURCE_EXTENDED macro is defined in the application program.

    NOTE: If the macro is not defined in your application program, you can define it while compiling the application.

To compile an application program that uses the SCTP APIs, enter the following command at the HP-UX prompt:

# cc –o <output_filename> -D_XOPEN_SOURCE_EXTENDED <input_filename> -lxnet –lsctp

where:

output_filename

Specifies the executable file name.

-D_XOPEN_SOURCE_EXTENDED

Specifies the XOPEN macro. You need to specify this macro while compiling only if you have not defined it in your application program. For more information on the XOPEN_SOURCE_EXTENDED macro, see xopen_networking(7).

input_filename

Specifies the name of the application program.

-lxnet

Specifies the /usr/lib/libxnet library. This option indicates that the application program must use the libraries defined in this library during compilation.

-lsctp

Specifies the libsctp library. This option indicates that the application program must use the libraries defined in this library during compilation.

Example 3-1 Sample Commands to Compile the Server and Client Programs

Consider a server application called srv.c and a client application called cli.c.

You can use the following command to compile the server application:

# cc –o srv -D_XOPEN_SOURCE_EXTENDED srv.c -lxnet –lsctp

You can use the following command to compile the client application:

# cc –o cli -D_XOPEN_SOURCE_EXTENDED cli.c -lxnet –lsctp

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