C/C++ Interface

The C/C++ Interface makes it possible to integrate Antenna House Formatter V7.4 into C/C++ programs.

Header Files

The following header files are included in [Install directory]/​include.

Header fileContentsLocation
xfoifc.hHeader for C++[Install directory]/​include
xfoifc_c.hHeader for C

Library Files

The following library files are included in [Install directory]/​lib or [Install directory]/​lib.

Library fileContentsLocation
C/C++ Interface Library for Windows[Install directory]
libXfoInterface.soC/C++ Interface Library for Linux [Install directory]/​lib
libXfoInterface.dylibC/C++ Interface Library for Macintosh[Install directory]/​lib

In Windows versions, the following library file for link is included in [Install directory]/​lib.

Library fileContentsLocation
XfoInterface.libLibrary for DLL linking[Install directory]/​lib

Compiler Issues

Windows

Antenna House Formatter V7.4 Windows versions are built using Microsoft Visual C++ 2015. MFC is not used without GUI. Use a compatible compiler for your program.

Linux

Antenna House Formatter V7.4 Linux version (64-bit version) is built using GCC 4.8. Your program must be compiled using GCC 4.8 or later. Amazon Linux 2 Graviton2 version is built using GCC 7.3. Your program must be compiled using GCC 7.3 or later. For more details about GCC, see “GCC, the GNU Compiler Collection”.

Macintosh

Antenna House Formatter V7.4 Macintosh version (64-bit version) is built using Xcode9.0 Apple LLVM version 9.0 (clang-900.0.37). Macintosh M1 version is built using Xcode12.4 LLVM 10.0.0 Apple clang version 12.0.0 (clang-1200.0.32.29).

Building the Sample Programs

You can download simple sample programs from our website.

Windows

In order to build a sample with the command line of Visual C++ in the Windows environment, execute the compiler from the console as follows:

The current directory of the following samples is the directory containing the cpp directory where the sample is unzipped.

> cd cpp
> cl -EHsc -I [Install directory]\include sample.cpp [Install directory]\lib\XfoInterface.lib /MT

To build the executables for Windows, use the command prompt from [Start]-[Microsoft Visual Studio 2015]-[Visual Studio Tools].

[Install directory]/​lib must be appended to the PATH environment variable in order to execute this program. The sample executes as follows:

> sample sample.fo sample.pdf

Linux

The following command-line shows how to build the sample in the Linux environment using GCC.

The current directory of the following samples is the directory containing the cpp directory where the sample is unzipped.

$ cd cpp
$ LD_LIBRARY_PATH=[Install directory]/lib:${LD_LIBRARY_PATH}
$ export LD_LIBRARY_PATH
$ g++ sample.cpp -I[Install directory]/include -L[Install directory]/lib -lXfoInterface -o Samplecppcmd -lstdc++ -lpthread

In order to execute the built sample program, a setup of other environment variables is necessary. For more details, see Environment Variables.

As mentioned previous, the GCC version is very important. Check your GCC version using the --version command-line option.

$ g++ --version
g++ (GCC) 4.8.0
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Macintosh

In order to build a sample in the Macintosh environment, execute the compiler from the terminal as follows:

The current directory of the following samples is the directory containing the cpp directory where the sample is unzipped.

$ cd cpp
$ g++ sample.cpp -I[Install directory]/include -L[Install directory]lib -lXfoInterface -Wl,-rpath,@executable_path[Install directory]/lib -o Samplecppcmd

To execute the built sample program, a setup of other environment variables is also necessary. For more details, see Environment Variables.

API Specification