In general, your C++ application must do the following:
Include the directory of the FME Objects header files in your project
Also include a directory for the FME Objects directory containing the header files (depending on where you installed FME Objects).
If you installed the 64-bit version of FME Server, be sure to set the target machine platform to x64.
Note: An easier approach is to just copy the contents of the FME Server C++ API folder into the directory of your application. By doing that you can avoid setting the Path Environment Variable.
#include <ifmeserversession.h>
A sample command-line demo application illustrating the use of the FME Server API is available in C++, .Net, and Java versions.
This demo can be used to ensure that everything has been setup properly, and contains code that may be useful for your development process. (More in-depth coverage can be found in the later sections.)
If security is enabled for FME Server, your application must provide a client ID that has been registered with FME Server. The client ID for the demo application is app_apidemo. By default, the demo's client ID is not registered with FME Server, and you must Resources.
The command-line application requires two parameters: the FME Server host and FME Server port.
Note: <fmeServerHost> represents the name of the host on which the FME Server is running.
<fmeServerPort> represents the TCP/IP port number the FME Server is listening on for requests. The default value is 7071 and this is usually correct for most FME Server installations.
The C++ source code was developed using Microsoft Visual Studio 2005 and is located in:
<FMEServerDir>\Server\sdk\samples\apidemo\cpp\FMEServer-APIDemo.cpp
...using the new project from the previous section
Add the source code to your project, and run.
...independently or with another IDE
This source code can be compiled and run against a default installation of FME Server. Please have the following files in the same directory as your program:
<FMEServerDir>\Server\sdk\cpp\fmeserverapi.dll
<FMEServerDir>\Server\sdk\cpp\icudt32_fme.dll
<FMEServerDir>\Server\sdk\cpp\icuin32_fme.dll
<FMEServerDir>\Server\sdk\cpp\icuuc32_fme.dll
<FMEServerDir>\Server\sdk\cpp\xerces-c_2_6_fme.dll
<FMEServerDir>\Server\sdk\cpp\messages directory