18.04.2015 Views

ArcGIS Engine Developer Guide

ArcGIS Engine Developer Guide

ArcGIS Engine Developer Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

C++ APPLICATION PROGRAMMING INTERFACE<br />

If desired, you can utilize the template makefiles provided with <strong>ArcGIS</strong> <strong>Engine</strong>.<br />

Makefile.SolarisMotif provides a starting point for Solaris Motif applications,<br />

and Makefile.LinuxMotif will get you started with Linux Motif applications.<br />

Refer to the next section for details on these templates.<br />

Below, $(ARCENGINEHOME) is used to refer to the root directory of your<br />

<strong>ArcGIS</strong> <strong>Engine</strong> install and should be defined once you have sourced arcgis/<br />

init_engine.sh (or .csh). For examples of each of these steps, see the template<br />

makefiles: Makefile.SolarisMotif and Makefile.LinuxMotif.<br />

1. Use the -I compiler option to add some additional include directories:<br />

• $(ARCENGINEHOME)/include<br />

• (Linux) /usr/X11R6/include (or the correct version for your installation)<br />

2. Use the -L linker option to specify some additional library directories:<br />

• $(ARCENGINEHOME)/bin<br />

• (Linux) /usr/X11R6/lib (or the correct version for your installation)<br />

3. Use the -l linker option link against some libraries:<br />

• (Linux) pthread<br />

• Xm<br />

• Xt<br />

• X11<br />

• arcsdk<br />

• motifctl<br />

• aoctl<br />

4. Use the -D compiler option to define the ESRI_UNIX symbol to direct the<br />

compiler to read the UNIX support headers from within ArcSDK.h.<br />

The template makefiles, Makefile.SolarisMotif<br />

and Makefile.LinuxMotif, can be found in <strong>ArcGIS</strong><br />

<strong>Developer</strong> Help under Development Environments<br />

> C++ > Makefiles.<br />

The comment text used here to describe the<br />

code of the makefile has been modified from the<br />

actual comments within the file to reflect the<br />

steps being taken.<br />

Customizing the templates Makefile.SolarisMotif and<br />

Makefile.LinuxMotif<br />

As a convenience, template makefiles, named Makefile.SolarisMotif for Solaris<br />

Motif applications and Makefile.LinuxMotif for Linux Motif applications, are<br />

included with <strong>ArcGIS</strong> <strong>Engine</strong> for your use. The following steps highlight the<br />

specific areas of those files that must be customized for you to use them in your<br />

development process. The modifications shown are based on an application that<br />

is written in a single code and a single header file, my_application.cpp and<br />

my_application.h, and produces an executable that takes in a single file at<br />

runtime.<br />

1. Throughout the makefile, update the program name, currently ‘motif_sample’,<br />

to reflect your application name. In this example, the program name is<br />

my_application.<br />

# Set up the program name<br />

PROGRAM = my_application.exe<br />

...<br />

220 • <strong>ArcGIS</strong> <strong>Engine</strong> <strong>Developer</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!