The page describes per platform how to install and use libnfc. Because some dependencies (e.g. libusb, PCSC-Lite) are used, the requirements per platform can differ.
First make sure you have required compilation dependencies, ie. you will need headers from:
Download and extract libnfc archive
$ wget http://libnfc.googlecode.com/files/libnfc-x.x.x.tar.gz $ tar -xvzf libnfc-x.x.x.tar.gz
Configure and compile
$ cd libnfc-x.x.x $ ./configure $ make
Make sure you have required run-time dependencies.
Plug in NFC device, place a tag on it and test your compilation
$ src/nfc-list
Install libnfc into your system
$ make install
Note: ./configure have an installation path prefix set as /usr/local as default. Use –prefix option, if you want another setup (see ./configure –help).
First make sure you have required compilation dependencies.
$ sudo apt-get install libusb-dev libpcsclite-dev
Download and extract libnfc archive
$ wget http://libnfc.googlecode.com/files/libnfc-x.x.x.tar.gz $ tar -xvzf libnfc-x.x.x.tar.gz
Build Debian package
$ cd libnfc-x.x.x $ svn checkout http://libnfc.googlecode.com/svn/tags/libnfc-x.x.x/debian $ dpkg-buildpackage -b -us -uc
Make sure you have required run-time dependencies.
$ sudo apt-get install libusb-0.1-4 libpcsclite1 libccid pcscd
Install libnfc into your system
$ sudo dpkg -i ../libnfc*.deb
Plug in NFC device, place a tag on it and test your installation
$ nfc-list
Romain Tartière contributed a FreeBSD port of libnfc, thanks to him.
cd /usr/ports/devel/libnfc/ && make install clean
pkg_add -r libnfc
Thanks to Mike Auty, libnfc have a ebuild to be easily installed on Gentoo using usual way:
$ emerge libnfc
Thanks to François Kooman, libnfc library is now included in Fedora 12+ distribution.
# yum install libnfc libnfc-devel libnfc-examples
compile your own applications requiring libnfc
For installing dependencies, MacPorts download manager is used (available at: http://distfiles.macports.org/MacPorts/)
Install MacPorts following instructions from http://www.macports.org/install.php
Install pkg-config:
$ sudo port install pkgconfig
Install glib:
$ sudo port install glib
Install glib:
$ sudo port install libusb
Make sure it's the x86_64 version (when on the latest OS X):
$ lipo -info /usr/local/lib/libusb.dylib
As the libnfc's MacPort is not up-to-date, now follow Manual installation instructions to compile libnfc using usual autotools way.
Warning: We have previously posted a link to darwinports .com, according to MacPorts project: they are an impostor / phishing site designed to get donations from unsuspecting users. Donations made to that site do not benefit MacPorts project and the instructions shown there for installing software are incorrect. To know more about this issue: http://trac.macports.org/wiki/DarwinPorts
Official MacPorts' site: http://www.macports.org/ If you are looking for how to use and install MacPorts, please visit: http://guide.macports.org/