• Libraries
  • Shop
  • Doc
  • Free Modbus
  • Support
  • Login
FieldTalk Modbus Master C++ Library  Library version 2.13.3
  • Introduction
  • Chapters
  • Modules
  • Classes
Linking your Applications against the Library

Windows Platforms: Compiling and Linking Applications

Let's assume the following project directory structure:

myprj
|
+-- myapp.cpp
+-+ fieldtalk
+-- include
+-+ lib
|
+-+ win
|
+-+ Win32
|
+-- Release

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

Visual Studio Example:

win_include.png

Visual C++ command line Example:

cl -I fieldtalk/include -c myapp.cpp

Add the file name of the library to the dependency list passed to the linker. Make sure the library chosen matches your CPU architecture (32-bit vs 64-bit). Use the Win32 library for 32-bit code and the x64 library for 64-bit code. Within Visual Studio you can use the macro to automatically select the correct library architecture. You also must pass the Winsock2 standard library Ws2_32.lib as additional dependency to the linker.

Visual Studio Example:

win_lib.png

Visual C++ command line Example:

cl -Fe myapp myapp.obj fieldtalk/lib/win/Win32/Release/libmbusmaster.lib Ws2_32.lib

Linux, UNIX and QNX Platforms: Compiling and Linking Applications

Let's assume the following project directory structure:

myprj
|
+-- myapp.cpp
+-+ fieldtalk
|
+-- include
+-+ lib
|
+-- linux (exact name depends on your platform)

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

Example:

c++ -I fieldtalk/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
  • FieldTalk Modbus Master C++ Library Library version 2.13.3
Speak to the Experts
Modbus Organization Member logo

We are member of the Modbus Organization, Inc.

Buy with Confidence
30-day money back guarantee All our FieldTalk web sales are backed by a 30-day Money Back Guarantee.
We Accept
Bank VISA MasterCard PayPal
Customer Info
  • Info & Contact
  • Customer Login
  • Terms of Service
  • Terms of Sale
  • Privacy Policy
© 2005-2025 proconX Pty Ltd. All rights reserved. proconX and FieldTalk are trademarks of proconX Pty Ltd.
All other trademarks and registered trademarks appearing on www.modbusdriver.com are the property of their respective owners.