You are here: FME Server Developer's Guide > Developing with the Core APIs > C++ > C++ Quick Start

C++ Quick Start

Setting Up a C++ Project Using Visual Studio

  1. Start Visual Studio.
  2. Choose File > New Project.
  3. The <FMEServerDir>\Server\sdk\cpp folder contains the files needed for the FME Server C++ API other than FME Objects.
  4. In general, your C++ application must do the following:

  5. Choose Project > Properties to open up the Properties dialog for the project. Under C/C++ > General > Additional Include Directories, add the path to the <FMEServerDir>\Server\sdk\cpp folder.
  6. Also include a directory for the FME Objects directory containing the header files (depending on where you installed FME Objects).

  7. If you installed the 64-bit version of FME Server, be sure to set the target machine platform to x64.

  8. Under C++ > Precompiled Headers, set Create/Use Precompiled Header to Not Using Precompiled Headers.
  9. Under Linker > Input > Additional Dependencies, add the path to the <FMEServerDir>\Server\sdk\cpp\fmeserverapi.lib file.
  10. Copy the <FMEServerDir>\Server\sdk\cpp\messages folder into the same directory of your application.
  11. Since our sample application is in a different folder from the FME Server C++ API folder, add the <FMEServerDir>\Server\sdk\cpp to the Path Environment Variable. You may need to restart Visual Studio or your computer for the new Path settings to take effect.
  12. 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.

  13. You can now start to create C++ applications using the FME Server C++ API interfaces by including any header files required. For example, to use the IFMEServerSession interface you would including the following in your source code:
  14. #include <ifmeserversession.h>

Running the API Sample demo...

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

Safe Software Inc. www.safe.com