Download Getting Started Guide - Community RTI Connext Users

Transcript
4.3.2.2.3
Building a Generated Example on Other Platforms
Use the generated makefile to compile a C or C++ example on a UNIX-based system or
a Java example on any system. Note: the generated makefile assumes the correct version
of the compiler is already on your path and that NDDSHOME is set.After compiling
gmake -f makefile_HelloWorld_<architecture>
the C or C++ example, you will find the application executables in a directory objs/
<architecture>.
The generated makefile includes the static release versions of the DDS libraries. To select
dynamic or debug versions of the libraries, edit the makefile to change the library suffixes. Generally, RTI Data Distribution Service uses the following convention for library
suffixes: "z" for static release, "zd" for static debug, none for dynamic release, and "d" for
dynamic debug. For a complete list of the required libraries for each configuration, see
the RTI Data Distribution Service Platform Notes.
For example, to change a C++ makefile from using static release to dynamic release
libraries, change this directive:
LIBS = -L$(NDDSHOME)/lib/<architecture> \
-lnddscppz -lnddscz -lnddscorez $(syslibs_<architecture>)
to:
LIBS = -L$(NDDSHOME)/lib/<architecture> \
-lnddscpp -lnddsc -lnddscore $(syslibs_<architecture>)
4.3.2.3
Running the Example Applications
Run the example publishing and subscribing applications and see them communicate:
4.3.2.3.1
Running the Generated C++ Example
First, start the subscriber application, HelloWorld_subscriber:
./objs/<architecture>/HelloWorld_subscriber
In this command window, you should see that the subscriber wakes up every four seconds to print a message:
HelloWorld subscriber sleeping for 4 sec...
HelloWorld subscriber sleeping for 4 sec...
HelloWorld subscriber sleeping for 4 sec...
4-16