Building the Application

Description

All path names are relative to the directory entered during the SwitchKit installation process.

UNIX

The Makefile included in the samples/src directory assumes the use of GNU make 3.74 or higher. It automatically compiles and links CallSim and simpleTandem as well as all of the other sample applications in the samples directory. The Makefile automatically determines which of the recommended platforms and compilers is being used. Executing the make command automatically builds all samples.

UNIX Troubleshooting

Syntax errors in Makefile on any UNIX platform:

• Make sure that the make utility you are using is at least GNU make 3.74 or higher. If you don't have access to this utility, then remove all platform definitions that are not relevant for the platform you wish to develop on.

Compilation or link errors:

• Make sure that the paths to lib and include directories are correct.

Building with Linux
Red Hat 6.0 - 6.2

1. Install all compat-egcs*.rpm files from the distribution disk (/mnt/cdrom/RedHat/RPMS)

• rpm -Uvh compat-egcs*.rpm

Important! You must have root access to complete this step!

2. cd to /samples/src and edit the Makefile. The following code appear near line 22:

ifeq ($(shell uname -s),Linux)

CCC = g++

CC = gcc

EXTRALIBS =-Ipthread

endif

Change the path name for the location of the 5.2 compatible compiler tools so that it is in CCC.

3. Make sure that you are not the root user when you start the build.

Windows® NT

The directory, samples/NTBuild contains a Visual C++® version 5.0 workspace, named samples.dsw. This workspace contains projects for each sample application included with the SwitchKit installation. After opening the workspace, right-click the project you want to build in the File View tab, then choose Build (selection only). The executables appears in samples/NTBuild/Debug/SimpleTandem or samples/NTBuild/Debug/CallSim. If the release version of the applications are built, the executables appears in samples/NTBuild/Release/SimpleTandem or samples/NTBuild/Release/CallSim.

Windows® Troubleshooting

Follow these instruction for problems, if you attempt to start a new project or if you want to change the workspace.

If you get the following error message:

Compilation error: fatal error C1083: Cannot open include file: 'SKC_API.h': No such file or directory

• Go to Project Settings,

• Select the C/C++ tab,

• Under Category, select Preprocessor,

• Make sure that the field "Additional include directories" shows:
../../include

If you get the following error message:

Link Error: CallSim.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall SKC_UserTimer::~SKC_UserTimer(void)" (??1SKC_UserTimer@@UAE@XZ)

• Make sure that include/BaseClasses.cpp and include/Messages.api.cpp are members of the project.

If a run time error occurs:

• Go to Project Settings,

• Select the C/C++ tab,

• Under Category, select Code Generation

• Set the field "Use run-time library" to Multithreaded DLL.

Linking to the SwitchKit API Library file

 

When you write an application you must link your application to the SwitchKit API library file: skapi.lib.

To link to the library file, for example, using Microsoft® Visual C++® Version 6.0, you would do the following steps.

1. On the menu select Project®Settings. The Project Settings dialog box opens.

2. Select the Link tab.

3. Type after the existing text in the text box for Object/library modules: skapi.lib.

4. Add the path to the library file in the text box for Project Options:

/libpath:"C:\Program Files\ Cantata\Switchkit\lib"

5. Click OK.

Proper Initialization

An error message will result, as described further on, when a message is sent before being properly initialized. You must call sk_initMsg() before sending the message. If the application should fail to call sk_initMsg() before sending the message, the following text will appear on the console and in the application's maintenance log:


"**Error:Aug 12 2003 09:30

:30: Received message with unknown engine type205 - is the sender of this message incorrectly using a pre-3.0 version of SwitchKit? This version of SwitchKit will not work with any pre-3.0versions."