C / C++

Top  Previous  Next

The pure C client has been written with portability in mind. As long a C compiler and a Posix compliant sockets library are available, it should be possible to compile the pure C client on any platform.

 

Compiling the C client

 

Prerequisites for compiling the C client is GCC or compatible C compiler and a Posix compliant sockets library.

Put the kbmMW C client source and makefile in any directory of your choise.

Issue the appropriate command matching your system:

-        For Unix/Linux: make -f makefile.unix

-        For Windows: make -f makefile.win32

 

This generates a libkbmMWClient.a file (for Unix/Linux) or libkbmMWClient.lib (for Windows) which is the library you need to link with when you compile your C clients.

 

On Unix/Linux, place the library file in the directory /usr/lib/kbmmw and place all include files (*.h) in /usr/include/kbmmw.

 

Sample

 

As C doesn't contain rich data types as variants or streams out, the pure C library have had to emulate those features to make the client compatible with RW NetServer 3. The implementation is designed to look like being 'object oriented' even though pure C doesn't contain any object orientation elements. The purpose of this is to have better grouping of the C libraries functionalities.

 

See the C/sample folder for an example of a pure C console client application.

 

When compiling the sample, remember to compile the kbmMW client source codes into the project, and make sure to refer to the appropriate Posix compliant sockets library during the linking phase.

 

The output from this application will be similar to this:

 

Result:

StatusCode=0 (OK)

Err=0, Node=8184, Dist=0.3002960321801950

 

More documentation

 

Find more documentation at:

http://www.components4programmers.com/downloads/kbmmw/documentation/kbmMW_C_client.pdf