关于windows下的开源库libmodbus的使用(ModBus协议)
剑指天大 2013-12-25 01:21:12
[color=#FF0000]下面是关于libmodbus的官方介绍,谁能帮我看一下在windows下用Visual Studio可以使用该库吗[/color]
The official website is [www.libmodbus.org](http://www.libmodbus.org).
The library is written in C and designed to run on Linux, Mac OS X, FreeBSD and
QNX and Windows.
Installation
------------
You will only need to install automake, autoconf, libtool and a C compiler (gcc
or clang) to compile the library and asciidoc and xmlto to generate the
documentation (optional).
To install, just run the usual dance, `./configure && make install`. Run
`./autogen.sh` first to generate the `configure` script if required.
You can change installation directory with prefix option, eg. `./configure
--prefix=/usr/local/`. You have to check that the installation library path is
properly set up on your system (`/etc/ld.so.conf.d`) and library cache is up to
date (run `ldconfig` as root if required).
The library provides a `libmodbus.pc` file to use with `pkg-config` to ease your
program compilation and linking.
If you want to compile with Microsoft Visual Studio, you need to install
<http://code.google.com/p/msinttypes/> to fill the absence of stdint.h.
To compile under Windows, install [MinGW](http://www.mingw.org/) and MSYS then
select the common packages (gcc, automake, libtool, etc). The directory
`./src/win32/` contains a Visual C project.
To compile under OS X with [homebrew](http://mxcl.github.com/homebrew/), you will need
to install the following dependencies first: `brew install autoconf automake libtool`.