[libhid-discuss] how to build test_libhid.c

skip hodgson skiphod at ozemail.com.au
Thu Sep 30 23:41:41 UTC 2010







> 
> Tristan Sun wrote:
> > I am new in Linux. I need use libhid,
> 
> Why? You could also take a look at HIDAPI for your HID communication
> needs.


The HIDAPI web-site contains the following note:
"These API calls can be used in any development environment that accepts DLLs
(e.g., Microsoft Visual C++ or Visual Basic).
   1.   System Requirements
      UsbHidApi requires a Windows laptop or desktop PC with the following
minimum capabilities:
          * Windows 98/2000/XP/Vista"
It is hard to see the value of sending a newbie there when he clearly states he
is trying to use Linux.

It is important to answer Charles' question though, "How did you install
libhid". Most usefully you should have the source code package available from
(for example)

svn://svn.debian.org/libhid/trunk
use the command
svn co svn://svn.debian.org/libhid/trunk

Once you have the source cd to the "trunk" and use the commands
./autogen.sh
./configure
make
make install

If you have all the necessary dependencies and nothing goes wrong with the build
you will already have the test_libhid program compiled for you and you can see
how it compiles and how it works.

We have made a copy of test_libhid.c which we are exploring for a proposed
development and which is called test_skip.c and located in the same directory as
test_libhid.c.  For your information the Makefile line we use to compile it is:

        gcc -g -O0 -DHAVE_CONFIG_H -I. -I.. -I../include -I../hidparser
-L/usr/lib -Wall -W -Werror  test_skip.c -lusb ../src/.libs/libhid.a -o test_skip

It works fine.

Cheers,
Skip.
 







More information about the libhid-discuss mailing list