FieldTalk Modbus® Master Protocol Library
C++ Editions
FOCUS Software Engineering

Main Page | Modules | Class Hierarchy | Compound List | Compound Members | Related Pages

Linking your Applications against the Library

Linux, UNIX and QNX Systems: Compiling and Linking Applications

Let's assume the following project directory structure:

             myprj
               |
               +-- fieldtalk
                   |
                   +-- doc
                   +-- src
                   +-- include
                   +-+ lib
                     |
                     +-- linux     (exact name depends on your platform)

Add the library's include directory to the compiler's include path.

Example:

c++ -Ifieldtalk/include -c myapp.cpp

Add the file name of the library to the file list passed to the linker.

Example:

c++ -o myapp myapp.o fieldtalk/lib/linux/libmbusmaster.a

Windows Systems: Compiling and Linking Applications

Let's assume the following project directory structure:

             myprj
               |
               +-- fieldtalk
                   |
                   +-- doc
                   +-- src
                   +-- include
                   +-+ lib
                     |
                     +-- win32_vc     (exact name depends on your platform)

Add the library's include directory to the compiler's include path.

Visual C++ Example:

cl -Ifieldtalk/include -c myapp.cpp
Borland C++ Example:
bcc32 -Ifieldtalk/include -c myapp.cpp

Add the file name of the library to the file list passed to the linker. Visual C++ only: If you are using the Modbus/TCP protocol you have to add the Winsock2 library Ws2_32.lib.

Visual C++ Example:

cl -Fe myapp myapp.obj fieldtalk/lib/win32_vc/libmbusmaster.lib Ws2_32.lib
Borland C++ Example:
bcc32 -e myapp myapp.obj fieldtalk/lib/win32_vc/libmbusmaster.lib