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 it is in the correct location and you are using either Solaris or Linux, the next<br />

thing to try is running arcgis/init_engine.sh (or .csh). The message may mean that<br />

$ARCENGINEHOME/include isn’t in the compiler’s include path. In the<br />

samples, our makefiles typically take care of adding this for you. However, if<br />

$ARCENGINEHOME isn’t set, it will fail, and it is set in the arcgis/init_engine<br />

script.<br />

Error: Please define either ESRI_WINDOWS or ESRI_UNIX<br />

You need to inform the compiler of which set of header files to use. On Windows,<br />

you need to define the ESRI_WINDOWS symbol. On Solaris and Linux,<br />

you need to define the ESRI_UNIX symbol. If you are using a makefile (either<br />

with nmake on Windows or make on Solaris or Linux), you will set this with the<br />

“D” compiler flag. In Visual Studio 6.0, you set it on the C/C++ tab of the<br />

Project Menu > Settings dialog box by selecting “Preprocessor” from the Category<br />

combo box and adding “ESRI_WINDOWS” to the “Preprocessor Definitions”<br />

textbox. In Visual Studio .NET 2003, the symbol is defined in the Project<br />

Menu > Properties dialog box in the C/C++ folder by clicking Preprocessor and<br />

adding “ESRI_WINDOWS” to the Preprocessor Definitions textbox.<br />

Windows-specific errors<br />

• Cannot open type library file esriSystem.olb<br />

This Windows error means that your sample is not compiling because it cannot<br />

open an ESRI OLB file. Make sure that you have the correct argument for the<br />

COM include directory, which is <strong>ArcGIS</strong>\Com in a default installation. If it is<br />

correct and it is still not working, make sure the file is in that directory.<br />

• Code is compiling but will not run. Sometimes I get an odd “abnormal<br />

program termination” error.<br />

On Windows, if samples or your own code compiles but fails to run, make<br />

sure you registered your <strong>ArcGIS</strong> <strong>Engine</strong>. Run the SoftwareAuthorization tool<br />

found in Start > All Programs > <strong>ArcGIS</strong> and follow its prompts.<br />

Solaris- and Linux-specific errors<br />

• Error: No valid runtime license was found.<br />

This means that you have not registered your <strong>ArcGIS</strong> <strong>Engine</strong>. Run the<br />

SoftwareAuthorization tool found in arcgis/authorizeSoftware and follow its<br />

prompts.<br />

• fatal: libarcsdk.so: open failed: No such file or directory (Solaris)<br />

OR<br />

/usr/bin/ld: cannot find -larcsdk (Linux)<br />

This tells you that $ARCENGINEHOME/bin isn’t in the<br />

LD_LIBRARY_PATH, which is set up when you run the arcgis/init_engine.sh<br />

(or .csh) script. Run the init_engine script.<br />

Chapter 4 • <strong>Developer</strong> environments • 233

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

Saved successfully!

Ooh no, something went wrong!