Topic: libnfc for Beginners

Hi

I am new to NFC readers and need some help using libnfc. I have downloaded the libnfc1.1.0 and I work on the Windows platform. I want to write a simple application to autolaunch a web browser for touch a tag. So that, this will be a standalone application, and I dont have to register with touchatag website. Where should I start?

Thank You

Re: libnfc for Beginners

Hi sheetalv021,

sheetalv021 wrote:

Hi
I want to write a simple application to autolaunch a web browser for touch a tag. So that, this will be a standalone application, and I dont have to register with touchatag website. Where should I start?

At first, you can start with the "list" example : you will be able to detect a card and extract some information like uid.
You also must know that you are using MIFARE ultralight tags if you use touchatag's tags : read some documentation about this tag type.

Romuald Conty

Re: libnfc for Beginners

Hi rconty

Thank You for the reply.

I started with the list example for the ACR 122 Reader, and was able to extract information. I also went through the code and am becoming familiar with the implementation of the libnfc api.

Re: libnfc for Beginners

Hello,
I am trying to read tags in cycle. As a base I used nfc-anticool example. The problem si, that first cycle is OK, it read Tag for example 0484b5d9a12580. After that I Drop the field for a while and make whole cycle again, but I got different (wrong) tag UID (44005180). What should I do to get the correct tags UID again (without exit the program and run it again)?

Is there any program to handle event when there is a new TAG on reader? (this is may final goal, but I can't solve such a simple task as read tags more time in one program without exit it).

Thanks

Re: libnfc for Beginners

I want to do something very similar, only i am hoping to make the program launch from a mifare classic 4k.  I know there is room on the card, but i don't know if i can make it self launch without having a host program running on the PC, other than of course the card reader and whatnot.  I am super new to this. I haven't even as of yet successfully launched libnfc. I downloaded everything last night at 3 am. it is such an exciting possibilty, and so overwhelming. i don't know where to start.

I am running windows 7 and have an Omnikey 5321 reader installed and running

Re: libnfc for Beginners

Hi!
I am a new developper on libnfc. I'm trying to install the libnfc on windows vista. I have readed the README-Windows.txt file. I've followed all the steps and I got this error :
c:\dev\libnfc-build>mingw32-make
Scanning dependencies of target nfc
[  5%] Building C object libnfc/CMakeFiles/nfc.dir/drivers/acr122.c.obj
C:\dev\libnfc-1.4.2\libnfc-1.4.2\libnfc\drivers\acr122.c: In function 'acr122_tr
ansceive':
C:\dev\libnfc-1.4.2\libnfc-1.4.2\libnfc\drivers\acr122.c:291:9: warning: implici
t declaration of function 'SCARD_CTL_CODE'
Linking C shared library libnfc.dll
Creating library file: libnfc.dll.a
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x89): undefined refe
rence to `SCardListReaders'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x20c): undefined ref
erence to `SCardReleaseContext'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x232): undefined ref
erence to `SCardEstablishContext'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x284): undefined ref
erence to `SCardEstablishContext'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x2bd): undefined ref
erence to `SCardReleaseContext'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x360): undefined ref
erence to `SCardListReaders'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x4e9): undefined ref
erence to `SCardReleaseContext'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x50f): undefined ref
erence to `SCardEstablishContext'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x547): undefined ref
erence to `SCardDisconnect'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x57d): undefined ref
erence to `SCardReleaseContext'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x644): undefined ref
erence to `SCardTransmit'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x6ad): undefined ref
erence to `SCARD_CTL_CODE'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x6e5): undefined ref
erence to `SCardControl'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x747): undefined ref
erence to `SCardTransmit'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x7cd): undefined ref
erence to `SCARD_CTL_CODE'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x801): undefined ref
erence to `SCardControl'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x877): undefined ref
erence to `SCardTransmit'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x8ca): undefined ref
erence to `SCardConnect'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x9b8): undefined ref
erence to `SCardConnect'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x9f0): undefined ref
erence to `SCardEstablishContext'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0xa5e): undefined ref
erence to `SCardTransmit'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0xa7b): undefined ref
erence to `SCARD_CTL_CODE'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0xaae): undefined ref
erence to `SCardControl'
collect2: ld returned 1 exit status
mingw32-make[2]: *** [libnfc/libnfc.dll] Error 1
mingw32-make[1]: *** [libnfc/CMakeFiles/nfc.dir/all] Error 2
mingw32-make: *** [all] Error 2

I really need your help.

Re: libnfc for Beginners

Hi,

Can you post the complete output when running "mingw32-make VERBOSE=1" please?

Re: libnfc for Beginners

glenn wrote:

Hi,

Can you post the complete output when running "mingw32-make VERBOSE=1" please?



c:\dev\libnfc-build>mingw32-make VERBOSE=1
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -HC:\dev\libnfc-1.4.2\libnfc-1.
4.2 -BC:\dev\libnfc-build --check-build-system CMakeFiles\Makefile.cmake 0
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_progress_start C:\dev\
libnfc-build\CMakeFiles C:\dev\libnfc-build\CMakeFiles\progress.marks
mingw32-make -f CMakeFiles\Makefile2 all
mingw32-make[1]: Entering directory `c:/dev/libnfc-build'
mingw32-make -f libnfc\CMakeFiles\nfc.dir\build.make libnfc/CMakeFiles/nfc.dir/d
epend
mingw32-make[2]: Entering directory `c:/dev/libnfc-build'
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_depends "MinGW Makefil
es" C:\dev\libnfc-1.4.2\libnfc-1.4.2 C:\dev\libnfc-1.4.2\libnfc-1.4.2\libnfc C:\
dev\libnfc-build C:\dev\libnfc-build\libnfc C:\dev\libnfc-build\libnfc\CMakeFile
s\nfc.dir\DependInfo.cmake --color=
mingw32-make[2]: Leaving directory `c:/dev/libnfc-build'
mingw32-make -f libnfc\CMakeFiles\nfc.dir\build.make libnfc/CMakeFiles/nfc.dir/b
uild
mingw32-make[2]: Entering directory `c:/dev/libnfc-build'
Linking C shared library libnfc.dll
cd C:\dev\libnfc-build\libnfc && "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe
" -E cmake_link_script CMakeFiles\nfc.dir\link.txt --verbose=1
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E remove -f CMakeFiles\nfc.dir
/objects.a
C:\MinGW64\bin\ar.exe cr CMakeFiles\nfc.dir/objects.a @CMakeFiles\nfc.dir\object
s1.rsp
C:\MinGW64\bin\gcc.exe   -m32 -shared -o libnfc.dll -Wl,--out-implib,libnfc.dll.
a -Wl,--major-image-version,0,--minor-image-version,0 -Wl,--whole-archive CMakeF
iles\nfc.dir/objects.a -Wl,--no-whole-archive C:\dev\libusb-win32-bin-1.2.4.0\li
b\gcc\libusb.a C:\dev\pcsc-lite-1.7.2\src\PCSC\pcsclite.h -lkernel32 -luser32 -l
gdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32
Creating library file: libnfc.dll.a
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x89): undefined refe
rence to `SCardListReaders'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x20c): undefined ref
erence to `SCardReleaseContext'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x232): undefined ref
erence to `SCardEstablishContext'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x284): undefined ref
erence to `SCardEstablishContext'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x2bd): undefined ref
erence to `SCardReleaseContext'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x360): undefined ref
erence to `SCardListReaders'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x4e9): undefined ref
erence to `SCardReleaseContext'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x50f): undefined ref
erence to `SCardEstablishContext'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x547): undefined ref
erence to `SCardDisconnect'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x57d): undefined ref
erence to `SCardReleaseContext'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x644): undefined ref
erence to `SCardTransmit'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x6ad): undefined ref
erence to `SCARD_CTL_CODE'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x6e5): undefined ref
erence to `SCardControl'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x747): undefined ref
erence to `SCardTransmit'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x7cd): undefined ref
erence to `SCARD_CTL_CODE'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x801): undefined ref
erence to `SCardControl'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x877): undefined ref
erence to `SCardTransmit'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x8ca): undefined ref
erence to `SCardConnect'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x9b8): undefined ref
erence to `SCardConnect'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x9f0): undefined ref
erence to `SCardEstablishContext'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0xa5e): undefined ref
erence to `SCardTransmit'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0xa7b): undefined ref
erence to `SCARD_CTL_CODE'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0xaae): undefined ref
erence to `SCardControl'
collect2: ld returned 1 exit status
mingw32-make[2]: *** [libnfc/libnfc.dll] Error 1
mingw32-make[2]: Leaving directory `c:/dev/libnfc-build'
mingw32-make[1]: *** [libnfc/CMakeFiles/nfc.dir/all] Error 2
mingw32-make[1]: Leaving directory `c:/dev/libnfc-build'
mingw32-make: *** [all] Error 2

thank you

Re: libnfc for Beginners

hi kchempes,

I see that you are including C:\dev\pcsc-lite-1.7.2\src\PCSC\pcsclite.h .
Is there any reason for this? Normally you should be fine with the one included in MinGW64..
Note that the include directory of minGW should be in your path (see README-Windows.txt).

Re: libnfc for Beginners

In fact i don't what are the libraries file. I modified the libraries files and now i get this error :

c:\dev\libnfc-build>mingw32-make VERBOSE=1
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -HC:\dev\libnfc-1.4.2\libnfc-1.
4.2 -BC:\dev\libnfc-build --check-build-system CMakeFiles\Makefile.cmake 0
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_progress_start C:\dev\
libnfc-build\CMakeFiles C:\dev\libnfc-build\CMakeFiles\progress.marks
mingw32-make -f CMakeFiles\Makefile2 all
mingw32-make[1]: Entering directory `c:/dev/libnfc-build'
mingw32-make -f libnfc\CMakeFiles\nfc.dir\build.make libnfc/CMakeFiles/nfc.dir/d
epend
mingw32-make[2]: Entering directory `c:/dev/libnfc-build'
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_depends "MinGW Makefil
es" C:\dev\libnfc-1.4.2\libnfc-1.4.2 C:\dev\libnfc-1.4.2\libnfc-1.4.2\libnfc C:\
dev\libnfc-build C:\dev\libnfc-build\libnfc C:\dev\libnfc-build\libnfc\CMakeFile
s\nfc.dir\DependInfo.cmake --color=
mingw32-make[2]: Leaving directory `c:/dev/libnfc-build'
mingw32-make -f libnfc\CMakeFiles\nfc.dir\build.make libnfc/CMakeFiles/nfc.dir/b
uild
mingw32-make[2]: Entering directory `c:/dev/libnfc-build'
Linking C shared library libnfc.dll
cd C:\dev\libnfc-build\libnfc && "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe
" -E cmake_link_script CMakeFiles\nfc.dir\link.txt --verbose=1
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E remove -f CMakeFiles\nfc.dir
/objects.a
C:\MinGW64\bin\ar.exe cr CMakeFiles\nfc.dir/objects.a @CMakeFiles\nfc.dir\object
s1.rsp
C:\MinGW64\bin\gcc.exe   -m32 -shared -o libnfc.dll -Wl,--out-implib,libnfc.dll.
a -Wl,--major-image-version,0,--minor-image-version,0 -Wl,--whole-archive CMakeF
iles\nfc.dir/objects.a -Wl,--no-whole-archive C:\MinGW64\lib\libusb.dll.a C:\Min
GW64\lib\libpcsclite.dll.a -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lol
e32 -loleaut32 -luuid -lcomdlg32 -ladvapi32
Creating library file: libnfc.dll.a
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x5b0): undefined ref
erence to `SCARD_CTL_CODE'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x7ee): undefined ref
erence to `SCARD_CTL_CODE'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x8fb): undefined ref
erence to `SCARD_CTL_CODE'
collect2: ld returned 1 exit status
mingw32-make[2]: *** [libnfc/libnfc.dll] Error 1
mingw32-make[2]: Leaving directory `c:/dev/libnfc-build'
mingw32-make[1]: *** [libnfc/CMakeFiles/nfc.dir/all] Error 2
mingw32-make[1]: Leaving directory `c:/dev/libnfc-build'
mingw32-make: *** [all] Error 2

I don't know how to fix it. help!!!

Re: libnfc for Beginners

Hi kchempes,

Please verify that all necessary directories are added to the PATH environment variable, as described in the readme.
Also i suggest to delete your build directory and rerun cmake, to get rid of cached cmake variables.
If it still fails please post the full output which shows the path var, the cmake output, and the mingw32-make output.

thanks,
Glenn

Re: libnfc for Beginners

Hi Glenn

It still fails and i'm starting to think that i can't get it worked on my Windows Vista 64. I think i missed something. So well i send you the outputs:

cmake output
Found LIBUSB: C:/MinGW64/x86_64_w64-mingw32/lib/libusb.a C:/dev/libusb-win32-bin-1.2.4.0/include
Found LIBUSB: C:/MinGW64/x86_64_w64-mingw32/lib/libusb.a C:/dev/libusb-win32-bin-1.2.4.0/include
Configuring done
Generating done

mingw32-make

c:\dev\build>mingw32-make
Scanning dependencies of target nfc
[  4%] Building C object libnfc/CMakeFiles/nfc.dir/nfc.c.obj
[  9%] Building C object libnfc/CMakeFiles/nfc.dir/iso14443-subr.c.obj
[ 14%] Building C object libnfc/CMakeFiles/nfc.dir/mirror-subr.c.obj
[ 19%] Building C object libnfc/CMakeFiles/nfc.dir/drivers/acr122.c.obj
C:\dev\libnfc-1.4.2\libnfc-1.4.2\libnfc\drivers\acr122.c: In function 'acr122_tr
ansceive':
C:\dev\libnfc-1.4.2\libnfc-1.4.2\libnfc\drivers\acr122.c:292:9: warning: implici
t declaration of function 'SCARD_CTL_CODE'
[ 23%] Building C object libnfc/CMakeFiles/nfc.dir/drivers/pn531_usb.c.obj
[ 28%] Building C object libnfc/CMakeFiles/nfc.dir/drivers/pn53x_usb.c.obj
[ 33%] Building C object libnfc/CMakeFiles/nfc.dir/drivers/pn533_usb.c.obj
[ 38%] Building C object libnfc/CMakeFiles/nfc.dir/drivers/arygon.c.obj
[ 42%] Building C object libnfc/CMakeFiles/nfc.dir/buses/uart.c.obj
In file included from C:\dev\libnfc-1.4.2\libnfc-1.4.2\libnfc\buses\uart.c:41:0:

C:\dev\libnfc-1.4.2\libnfc-1.4.2\libnfc\buses\/uart_win32.c: In function 'uart_o
pen':
C:\dev\libnfc-1.4.2\libnfc-1.4.2\libnfc\buses\/uart_win32.c:40:3: warning: impli
cit declaration of function '_strupr'
[ 47%] Building C object libnfc/CMakeFiles/nfc.dir/chips/pn53x.c.obj
C:\dev\libnfc-1.4.2\libnfc-1.4.2\libnfc\chips\pn53x.c: In function 'pn53x_init':

C:\dev\libnfc-1.4.2\libnfc-1.4.2\libnfc\chips\pn53x.c:113:3: warning: implicit d
eclaration of function 'strdup'
C:\dev\libnfc-1.4.2\libnfc-1.4.2\libnfc\chips\pn53x.c:113:10: warning: assignmen
t makes pointer from integer without a cast
Linking C shared library libnfc.dll
Creating library file: libnfc.dll.a
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x5f): undefined refe
rence to `SCardEstablishContext'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0xac): undefined refe
rence to `SCardReleaseContext'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x1a2): undefined ref
erence to `SCardListReaders'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x366): undefined ref
erence to `SCardConnect'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x39f): undefined ref
erence to `SCardConnect'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x4d6): undefined ref
erence to `SCardDisconnect'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x5b0): undefined ref
erence to `SCARD_CTL_CODE'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x5e9): undefined ref
erence to `SCardControl'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x648): undefined ref
erence to `SCardTransmit'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x700): undefined ref
erence to `SCardTransmit'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x7ee): undefined ref
erence to `SCARD_CTL_CODE'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x823): undefined ref
erence to `SCardControl'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x866): undefined ref
erence to `SCardTransmit'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x8fb): undefined ref
erence to `SCARD_CTL_CODE'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x92f): undefined ref
erence to `SCardControl'
CMakeFiles\nfc.dir/objects.a(acr122.c.obj):acr122.c:(.text+0x972): undefined ref
erence to `SCardTransmit'
collect2: ld returned 1 exit status
mingw32-make[2]: *** [libnfc/libnfc.dll] Error 1
mingw32-make[1]: *** [libnfc/CMakeFiles/nfc.dir/all] Error 2
mingw32-make: *** [all] Error 2

PATH

c:\dev\build>path
PATH=C:\Program Files (x86)\PC Connectivity Solution\;C:\Windows\system32;C:\Win
dows;C:\Windows\System32\Wbem;c:\Program Files (x86)\ATI Technologies\ATI.ACE\Co
re-Static;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\Program
Files (x86)\Common Files\Roxio Shared\10.0\DLLShared\;C:\Program Files (x86)\Co
mmon Files\DivX Shared\;C:\Program Files (x86)\ImageConverter Plus;C:\Program Fi
les (x86)\ImageConverter Plus\Microsoft.VC80.CRT;C:\Program Files (x86)\ImageCon
verter Plus\Microsoft.VC80.MFC;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Win
dows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Subversion\bin,C:\d
ev\libusb-win32-bin-1.2.4.0\include;C:\MinGW64\bin;C:\MinGW64\bin;C:\dev\doxygen
\doxygen-1.6.1-2\usr\bin; C:\MinGW64\lib;C:\MinGW64\x86_64_w64-mingw32\include;C
:\MinGW64\x86_64_w64-mingw32\lib;C:\MinGW64\x86_64_w64-mingw32\lib32\;C:\dev\lib
usb-win32-bin-1.2.4.0\include;C:\dev\pcsc-lite-1.7.2\lib;C:\Program Files (x86)\
CMake 2.8\bin;C:\MinGW64\lib;

Thank you for your help.

Re: libnfc for Beginners

Are you sure you set correctly PCSC_LIBRARIES value in cmake ? I don't know how to set it from command line, you can set it for sure using cmake-gui.
You should set it to C:/MinGW64/x86_64-w64-mingw32/lib/libwinscard.a

Hope this helps

Leo

Re: libnfc for Beginners

normally setting this manually should not be necessary, the FindPCSC.cmake module should be able to determine this if everything is installed and the path is set up correctly.
The path seems OK on first sight, can you check if the file winscard.h exists in directory C:\MinGW64\x86_64_w64-mingw32\include ?

Re: libnfc for Beginners

Yes the PCSC_LIBRARIES is set correctly. In cmake-gui i don't have errors but it just doesn't work. What libnfc should I use? I'm using libnfc-1.4.2 on windows vista. Now I moved on Windows 7 because I thought it was a problem of vista but i still got the same error.

Re: libnfc for Beginners

Ok what about the LIBUSB_LIBRARIES and LIBUSB_INCLUDE_DIRS? thank you

Re: libnfc for Beginners

Should be found automatically as well if you install it like described in the README file.
It looks in your Program Files directory for a LibUSB-Win32 directory. Note that you should rename the dll file as described.

Re: libnfc for Beginners

I have installed finally the libnfc but when i execute nfc-list i got
nfc-list use libnfc 1.4.2
No NFC device found.

When my Smartcard reader ACR122U is connected

Re: libnfc for Beginners

Hello,

Turn ON debug mode, that could help to find what is going wrong.

You could also try the development version.

Romuald Conty

Re: libnfc for Beginners

Hi,

I have a very similar error while trying to install libnfc on Windows 7 64 bit OS.
Kindly help as I have tried cleaning and rebuilding cmake multiple times.
Below is the error that I get after I execute the command 'mingw32-make VERBOSE=1'
+++++++++++++++++++++++++++++++++++++++++
D:\Software development\nfc\libnfc.org\libnfc-build 1>mingw32-make VERBOSE=1
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -H"D:\Software development\nfc\libnfc.org\libnfc-1.6.0-rc1" -B"D:\Software development\nfc\libnfc.org\libnfc-build 1" --check-build-system CMakeFiles\Makefile.cmake 0
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_progress_start "D:\Software development\nfc\libnfc.org\libnfc-build 1\CMakeFiles" "D:\Software development\nfc\libnfc.org\libnfc-build 1\CMakeFiles\progress.marks"
mingw32-make -f CMakeFiles\Makefile2 all
mingw32-make[1]: Entering directory `D:/Software development/nfc/libnfc.org/libnfc-build 1'
mingw32-make -f libnfc\CMakeFiles\nfc.dir\build.make libnfc/CMakeFiles/nfc.dir/depend
mingw32-make[2]: Entering directory `D:/Software development/nfc/libnfc.org/libnfc-build 1'
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_depends "MinGW Makefiles" "D:\Software development\nfc\libnfc.org\libnfc-1.6.0-rc1" "D:\Software development\nfc\libnfc.org\libnfc-1.6.0-rc1\libnfc" "D:\Software development\nfc\libnfc.org\libnfc-build 1" "D:\Software development\nfc\libnfc.org\libnfc-build 1\libnfc" "D:\Software development\nfc\libnfc.org\libnfc-build 1\libnfc\CMakeFiles\nfc.dir\DependInfo.cmake" --color=Dependee "D:\Software development\nfc\libnfc.org\libnfc-build 1\libnfc\CMakeFiles\nfc.dir\DependInfo.cmake" is newer than depender "D:/Software development/nfc/libnfc.org/libnfc-build 1/libnfc/CMakeFiles/nfc.dir/depend.internal".
Dependee "D:/Software development/nfc/libnfc.org/libnfc-build 1/libnfc/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "D:/Software development/nfc/libnfc.org/libnfc-build 1/libnfc/CMakeFiles/nfc.dir/depend.internal".
Scanning dependencies of target nfc
mingw32-make[2]: Leaving directory `D:/Software development/nfc/libnfc.org/libnfc-build 1'
mingw32-make -f libnfc\CMakeFiles\nfc.dir\build.make libnfc/CMakeFiles/nfc.dir/build
mingw32-make[2]: Entering directory `D:/Software development/nfc/libnfc.org/libnfc-build 1'
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_progress_report "D:\Software development\nfc\libnfc.org\libnfc-build 1\CMakeFiles" 1
[  3%] Building C object libnfc/CMakeFiles/nfc.dir/nfc.c.obj
cd /d D:\SOFTWA~1\nfc\libnfc.org\LIBNFC~2\libnfc && c:\MinGW64\bin\gcc.exe  -DDRIVER_ACR122_ENABLED -DDRIVER_ARYGON_ENABLED -DDRIVER_PN53X_USB_ENABLED -DHAVE_CONFIG_H -Dnfc_EXPORTS -Du_int16_t=uint16_t -Du_int8_t=uint8_t @CMakeFiles/nfc.dir/includes_C.rsp   -Wall -pedantic -std=c99 -m32 -o CMakeFiles\nfc.dir\nfc.c.obj
  -c "D:\Software development\nfc\libnfc.org\libnfc-1.6.0-rc1\libnfc\nfc.c"
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_progress_report "D:\Software development\nfc\libnfc.org\libnfc-build 1\CMakeFiles" 2
[  6%] Building C object libnfc/CMakeFiles/nfc.dir/nfc-device.c.obj
cd /d D:\SOFTWA~1\nfc\libnfc.org\LIBNFC~2\libnfc && c:\MinGW64\bin\gcc.exe  -DDRIVER_ACR122_ENABLED -DDRIVER_ARYGON_ENABLED -DDRIVER_PN53X_USB_ENABLED -DHAVE_CONFIG_H -Dnfc_EXPORTS -Du_int16_t=uint16_t -Du_int8_t=uint8_t @CMakeFiles/nfc.dir/includes_C.rsp   -Wall -pedantic -std=c99 -m32 -o CMakeFiles\nfc.dir\nfc-device.c.obj   -c "D:\Software development\nfc\libnfc.org\libnfc-1.6.0-rc1\libnfc\nfc-device.c"
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_progress_report "D:\Software development\nfc\libnfc.org\libnfc-build 1\CMakeFiles" 3
[ 10%] Building C object libnfc/CMakeFiles/nfc.dir/nfc-emulation.c.obj
cd /d D:\SOFTWA~1\nfc\libnfc.org\LIBNFC~2\libnfc && c:\MinGW64\bin\gcc.exe  -DDRIVER_ACR122_ENABLED -DDRIVER_ARYGON_ENABLED -DDRIVER_PN53X_USB_ENABLED -DHAVE_CONFIG_H -Dnfc_EXPORTS -Du_int16_t=uint16_t -Du_int8_t=uint8_t @CMakeFiles/nfc.dir/includes_C.rsp   -Wall -pedantic -std=c99 -m32 -o CMakeFiles\nfc.dir\nfc-emulation.c.obj   -c "D:\Software development\nfc\libnfc.org\libnfc-1.6.0-rc1\libnfc\nfc-emulation.c"
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_progress_report "D:\Software development\nfc\libnfc.org\libnfc-build 1\CMakeFiles" 4
[ 13%] Building C object libnfc/CMakeFiles/nfc.dir/nfc-internal.c.obj
cd /d D:\SOFTWA~1\nfc\libnfc.org\LIBNFC~2\libnfc && c:\MinGW64\bin\gcc.exe  -DDRIVER_ACR122_ENABLED -DDRIVER_ARYGON_ENABLED -DDRIVER_PN53X_USB_ENABLED -DHAVE_CONFIG_H -Dnfc_EXPORTS -Du_int16_t=uint16_t -Du_int8_t=uint8_t @CMakeFiles/nfc.dir/includes_C.rsp   -Wall -pedantic -std=c99 -m32 -o CMakeFiles\nfc.dir\nfc-internal.c.obj   -c "D:\Software development\nfc\libnfc.org\libnfc-1.6.0-rc1\libnfc\nfc-internal.c"
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_progress_report "D:\Software development\nfc\libnfc.org\libnfc-build 1\CMakeFiles" 5
[ 16%] Building C object libnfc/CMakeFiles/nfc.dir/iso14443-subr.c.obj
cd /d D:\SOFTWA~1\nfc\libnfc.org\LIBNFC~2\libnfc && c:\MinGW64\bin\gcc.exe  -DDRIVER_ACR122_ENABLED -DDRIVER_ARYGON_ENABLED -DDRIVER_PN53X_USB_ENABLED -DHAVE_CONFIG_H -Dnfc_EXPORTS -Du_int16_t=uint16_t -Du_int8_t=uint8_t @CMakeFiles/nfc.dir/includes_C.rsp   -Wall -pedantic -std=c99 -m32 -o CMakeFiles\nfc.dir\iso14443-subr.c.obj   -c "D:\Software development\nfc\libnfc.org\libnfc-1.6.0-rc1\libnfc\iso14443-subr.c"
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_progress_report "D:\Software development\nfc\libnfc.org\libnfc-build 1\CMakeFiles" 6
[ 20%] Building C object libnfc/CMakeFiles/nfc.dir/mirror-subr.c.obj
cd /d D:\SOFTWA~1\nfc\libnfc.org\LIBNFC~2\libnfc && c:\MinGW64\bin\gcc.exe  -DDRIVER_ACR122_ENABLED -DDRIVER_ARYGON_ENABLED -DDRIVER_PN53X_USB_ENABLED -DHAVE_CONFIG_H -Dnfc_EXPORTS -Du_int16_t=uint16_t -Du_int8_t=uint8_t @CMakeFiles/nfc.dir/includes_C.rsp   -Wall -pedantic -std=c99 -m32 -o CMakeFiles\nfc.dir\mirror-subr.c.obj   -c "D:\Software development\nfc\libnfc.org\libnfc-1.6.0-rc1\libnfc\mirror-subr.c"
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_progress_report "D:\Software development\nfc\libnfc.org\libnfc-build 1\CMakeFiles" 7
[ 23%] Building C object libnfc/CMakeFiles/nfc.dir/drivers/acr122.c.obj
cd /d D:\SOFTWA~1\nfc\libnfc.org\LIBNFC~2\libnfc && c:\MinGW64\bin\gcc.exe  -DDRIVER_ACR122_ENABLED -DDRIVER_ARYGON_ENABLED -DDRIVER_PN53X_USB_ENABLED -DHAVE_CONFIG_H -Dnfc_EXPORTS -Du_int16_t=uint16_t -Du_int8_t=uint8_t @CMakeFiles/nfc.dir/includes_C.rsp   -Wall -pedantic -std=c99 -m32 -o CMakeFiles\nfc.dir\drivers\acr122.c.obj   -c "D:\Software development\nfc\libnfc.org\libnfc-1.6.0-rc1\libnfc\drivers\acr122.c"
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_progress_report "D:\Software development\nfc\libnfc.org\libnfc-build 1\CMakeFiles" 8
[ 26%] Building C object libnfc/CMakeFiles/nfc.dir/drivers/pn53x_usb.c.obj
cd /d D:\SOFTWA~1\nfc\libnfc.org\LIBNFC~2\libnfc && c:\MinGW64\bin\gcc.exe  -DDRIVER_ACR122_ENABLED -DDRIVER_ARYGON_ENABLED -DDRIVER_PN53X_USB_ENABLED -DHAVE_CONFIG_H -Dnfc_EXPORTS -Du_int16_t=uint16_t -Du_int8_t=uint8_t @CMakeFiles/nfc.dir/includes_C.rsp   -Wall -pedantic -std=c99 -m32 -o CMakeFiles\nfc.dir\drivers\pn53x_usb.c.obj   -c "D:\Software development\nfc\libnfc.org\libnfc-1.6.0-rc1\libnfc\drivers\pn53x_usb.c"
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_progress_report "D:\Software development\nfc\libnfc.org\libnfc-build 1\CMakeFiles" 9
[ 30%] Building C object libnfc/CMakeFiles/nfc.dir/drivers/arygon.c.obj
cd /d D:\SOFTWA~1\nfc\libnfc.org\LIBNFC~2\libnfc && c:\MinGW64\bin\gcc.exe  -DDRIVER_ACR122_ENABLED -DDRIVER_ARYGON_ENABLED -DDRIVER_PN53X_USB_ENABLED -DHAVE_CONFIG_H -Dnfc_EXPORTS -Du_int16_t=uint16_t -Du_int8_t=uint8_t @CMakeFiles/nfc.dir/includes_C.rsp   -Wall -pedantic -std=c99 -m32 -o CMakeFiles\nfc.dir\drivers\arygon.c.obj   -c "D:\Software development\nfc\libnfc.org\libnfc-1.6.0-rc1\libnfc\drivers\arygon.c"
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_progress_report "D:\Software development\nfc\libnfc.org\libnfc-build 1\CMakeFiles" 10
[ 33%] Building C object libnfc/CMakeFiles/nfc.dir/buses/uart.c.obj
cd /d D:\SOFTWA~1\nfc\libnfc.org\LIBNFC~2\libnfc && c:\MinGW64\bin\gcc.exe  -DDRIVER_ACR122_ENABLED -DDRIVER_ARYGON_ENABLED -DDRIVER_PN53X_USB_ENABLED -DHAVE_CONFIG_H -Dnfc_EXPORTS -Du_int16_t=uint16_t -Du_int8_t=uint8_t @CMakeFiles/nfc.dir/includes_C.rsp   -Wall -pedantic -std=c99 -m32 -o CMakeFiles\nfc.dir\buses\uart.c.obj   -c "D:\Software development\nfc\libnfc.org\libnfc-1.6.0-rc1\libnfc\buses\uart.c"
In file included from D:\Software development\nfc\libnfc.org\libnfc-1.6.0-rc1\libnfc\buses\uart.c:41:0:
D:\Software development\nfc\libnfc.org\libnfc-1.6.0-rc1\libnfc\buses\uart_win32.c: In function 'uart_receive':
D:\Software development\nfc\libnfc.org\libnfc-1.6.0-rc1\libnfc\buses\uart_win32.c:159:87: warning: ISO C99 requires rest arguments to be used [enabled by default]
D:\Software development\nfc\libnfc.org\libnfc-1.6.0-rc1\libnfc\buses\uart_win32.c:168:58: warning: ISO C99 requires rest arguments to be used [enabled by default]
In file included from D:/Software development/nfc/libnfc.org/libnfc-1.6.0-rc1/contrib/windows.h:31:0,
                 from D:/Software development/nfc/libnfc.org/libnfc-1.6.0-rc1/config.h:1,
                 from D:\Software development\nfc\libnfc.org\libnfc-1.6.0-rc1\libnfc\buses\uart.c:27:
D:/Software development/nfc/libnfc.org/libnfc-1.6.0-rc1/contrib/win32/err.h:17:13: warning: unused variable 'errx' [-Wunused-variable]
In file included from D:\Software development\nfc\libnfc.org\libnfc-1.6.0-rc1\libnfc\buses\uart.c:41:0:
D:\Software development\nfc\libnfc.org\libnfc-1.6.0-rc1\libnfc\buses\uart_win32.c: In function 'uart_send':
D:\Software development\nfc\libnfc.org\libnfc-1.6.0-rc1\libnfc\buses\uart_win32.c:209:87: warning: ISO C99 requires rest arguments to be used [enabled by default]
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_progress_report "D:\Software development\nfc\libnfc.org\libnfc-build 1\CMakeFiles" 11
[ 36%] Building C object libnfc/CMakeFiles/nfc.dir/chips/pn53x.c.obj
cd /d D:\SOFTWA~1\nfc\libnfc.org\LIBNFC~2\libnfc && c:\MinGW64\bin\gcc.exe  -DDRIVER_ACR122_ENABLED -DDRIVER_ARYGON_ENABLED -DDRIVER_PN53X_USB_ENABLED -DHAVE_CONFIG_H -Dnfc_EXPORTS -Du_int16_t=uint16_t -Du_int8_t=uint8_t @CMakeFiles/nfc.dir/includes_C.rsp   -Wall -pedantic -std=c99 -m32 -o CMakeFiles\nfc.dir\chips\pn53x.c.obj   -c "D:\Software development\nfc\libnfc.org\libnfc-1.6.0-rc1\libnfc\chips\pn53x.c"
Linking C shared library libnfc.dll
cd /d D:\SOFTWA~1\nfc\libnfc.org\LIBNFC~2\libnfc && "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_link_script CMakeFiles\nfc.dir\link.txt --verbose=1
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E remove -f CMakeFiles\nfc.dir/objects.a
c:\MinGW64\bin\ar.exe cr CMakeFiles\nfc.dir/objects.a @CMakeFiles\nfc.dir\objects1.rsp
c:\MinGW64\bin\gcc.exe   -m32 -shared -o libnfc.dll -Wl,--out-implib,libnfc.dll.a -Wl,--major-image-version,0,--minor-image-version,0 -Wl,--whole-archive CMakeFiles\nfc.dir/objects.a -Wl,--no-whole-archive c:\MinGW64\x86_64-w64-mingw32\lib32\libwinscard.a "D:\Software development\usb\libusb\libusb-win32-bin-1.2.6.0\lib\msvc_x64\libusb.lib" -lwsock32 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32
CMakeFiles\nfc.dir/objects.a(pn53x_usb.c.obj):pn53x_usb.c:(.text+0x31): undefined reference to `usb_bulk_read'
CMakeFiles\nfc.dir/objects.a(pn53x_usb.c.obj):pn53x_usb.c:(.text+0x72): undefined reference to `usb_bulk_write'
CMakeFiles\nfc.dir/objects.a(pn53x_usb.c.obj):pn53x_usb.c:(.text+0xc1): undefined reference to `usb_bulk_write'
CMakeFiles\nfc.dir/objects.a(pn53x_usb.c.obj):pn53x_usb.c:(.text+0x230): undefined reference to `usb_init'
CMakeFiles\nfc.dir/objects.a(pn53x_usb.c.obj):pn53x_usb.c:(.text+0x235): undefined reference to `usb_find_busses'
CMakeFiles\nfc.dir/objects.a(pn53x_usb.c.obj):pn53x_usb.c:(.text+0x253): undefined reference to `usb_find_devices'
CMakeFiles\nfc.dir/objects.a(pn53x_usb.c.obj):pn53x_usb.c:(.text+0x281): undefined reference to `usb_get_busses'
CMakeFiles\nfc.dir/objects.a(pn53x_usb.c.obj):pn53x_usb.c:(.text+0x355): undefined reference to `usb_open'
CMakeFiles\nfc.dir/objects.a(pn53x_usb.c.obj):pn53x_usb.c:(.text+0x36b): undefined reference to `usb_set_configuration'
CMakeFiles\nfc.dir/objects.a(pn53x_usb.c.obj):pn53x_usb.c:(.text+0x37f): undefined reference to `usb_close'
CMakeFiles\nfc.dir/objects.a(pn53x_usb.c.obj):pn53x_usb.c:(.text+0x38c): undefined reference to `usb_close'
CMakeFiles\nfc.dir/objects.a(pn53x_usb.c.obj):pn53x_usb.c:(.text+0x56a): undefined reference to `usb_get_string_simple'
CMakeFiles\nfc.dir/objects.a(pn53x_usb.c.obj):pn53x_usb.c:(.text+0x5d0): undefined reference to `usb_get_string_simple'
CMakeFiles\nfc.dir/objects.a(pn53x_usb.c.obj):pn53x_usb.c:(.text+0x6db): undefined reference to `usb_init'
CMakeFiles\nfc.dir/objects.a(pn53x_usb.c.obj):pn53x_usb.c:(.text+0x6e0): undefined reference to `usb_find_busses'
CMakeFiles\nfc.dir/objects.a(pn53x_usb.c.obj):pn53x_usb.c:(.text+0x6f8): undefined reference to `usb_find_devices'
CMakeFiles\nfc.dir/objects.a(pn53x_usb.c.obj):pn53x_usb.c:(.text+0x710): undefined reference to `usb_get_busses'
CMakeFiles\nfc.dir/objects.a(pn53x_usb.c.obj):pn53x_usb.c:(.text+0x783): undefined reference to `usb_open'
CMakeFiles\nfc.dir/objects.a(pn53x_usb.c.obj):pn53x_usb.c:(.text+0x7ab): undefined reference to `usb_set_configuration'
CMakeFiles\nfc.dir/objects.a(pn53x_usb.c.obj):pn53x_usb.c:(.text+0x7bf): undefined reference to `usb_close'
CMakeFiles\nfc.dir/objects.a(pn53x_usb.c.obj):pn53x_usb.c:(.text+0x7d7): undefined reference to `usb_claim_interface'
CMakeFiles\nfc.dir/objects.a(pn53x_usb.c.obj):pn53x_usb.c:(.text+0x7eb): undefined reference to `usb_close'
CMakeFiles\nfc.dir/objects.a(pn53x_usb.c.obj):pn53x_usb.c:(.text+0x919): undefined reference to `usb_close'
CMakeFiles\nfc.dir/objects.a(pn53x_usb.c.obj):pn53x_usb.c:(.text+0x9df): undefined reference to `usb_release_interface'
CMakeFiles\nfc.dir/objects.a(pn53x_usb.c.obj):pn53x_usb.c:(.text+0x9f2): undefined reference to `usb_close'
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\nfc.dir/objects.a(pn53x_usb.c.obj): bad relocaddress 0x4c in section `.rdata'
collect2.exe: error: ld returned 1 exit status
mingw32-make[2]: *** [libnfc/libnfc.dll] Error 1
mingw32-make[2]: Leaving directory `D:/Software development/nfc/libnfc.org/libnfc-build 1'
mingw32-make[1]: *** [libnfc/CMakeFiles/nfc.dir/all] Error 2
mingw32-make[1]: Leaving directory `D:/Software development/nfc/libnfc.org/libnfc-build 1'
mingw32-make: *** [all] Error 2

D:\Software development\nfc\libnfc.org\libnfc-build 1>
+++++++++++++++++++++++++++++++++++++++++

Some highlights:
1) System Environment Path value = %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\DMIX;C:\Program Files (x86)\Common Files\Adobe\AGL;C:\Program Files\MySQL\MySQL Server 5.1\bin;c:\MinGW64\bin;c:\MinGW64\x86_64-w64-mingw32\lib32;c:\MinGW64\x86_64-w64-mingw32\include;C:\Program Files (x86)\CMake 2.8\bin
2) While executing 'cmake-gui .' command, as instructed in libnfc readme file, it is 'Press "Configure", specify "MinGW32 Makefiles"'.
But in my configure, there is no "MinGW32 Makefiles" options, I selected 'MinGW Makefiles'. I hope this should not be an issue.
3) When my ACR122U is connect to USB port, Output of 'testlibusb-win' application is as below:
===============================
DLL version:    1.2.6.0
Driver version:    1.2.6.0

bus/device  idVendor/idProduct
bus-0/\\.\libusb0-0001--0x072f-0x2200     072F/2200
- Manufacturer : ACS
- Product      : ACR122U PICC Interface
bLength:             18
bDescriptorType:     01h
bcdUSB:              0110h
bDeviceClass:        00h
bDeviceSubClass:     00h
bDeviceProtocol:     00h
bMaxPacketSize0:     08h
idVendor:            072Fh
idProduct:           2200h
bcdDevice:           0207h
iManufacturer:       1
iProduct:            2
iSerialNumber:       0
bNumConfigurations:  1
  wTotalLength:         93
  bNumInterfaces:       1
  bConfigurationValue:  1
  iConfiguration:       0
  bmAttributes:         80h
  MaxPower:             100
    bInterfaceNumber:   0
    bAlternateSetting:  0
    bNumEndpoints:      3
    bInterfaceClass:    11
    bInterfaceSubClass: 0
    bInterfaceProtocol: 0
    iInterface:         0
      bEndpointAddress: 81h
      bmAttributes:     03h
      wMaxPacketSize:   8
      bInterval:        2
      bRefresh:         0
      bSynchAddress:    0
      bEndpointAddress: 02h
      bmAttributes:     02h
      wMaxPacketSize:   64
      bInterval:        0
      bRefresh:         0
      bSynchAddress:    0
      bEndpointAddress: 82h
      bmAttributes:     02h
      wMaxPacketSize:   64
      bInterval:        0
      bRefresh:         0
      bSynchAddress:    0
===============================

Thanks and Regards,
Chand

Re: libnfc for Beginners

Dear Community members,

Can anyone assist?
Need your help to resolve this issue so that I can make a kick start on NFC development using libNFC using ACR122U PCD.

Thanks in advance,
Chand

Re: libnfc for Beginners

Hi Chand,

I applaud the work of libnfc and all the effort that has been put into it.  That said, the majority of the benefit is lost since building it on Windows is essentially impossible unless you're a real software wizard.  I'm a pretty technical person, but not an expert software developer so I have found almost no utility in libnfc since building/compiling it is a task from hell that has resulted in many wasted hours of my life. 

I have been able to compile and build some previous versions such as 1.5.1 but I have had no luck with the latest release, all I get is error after error after error.


If some of the community members that know how to build libnfc 1.7.1 on Windows, particularly the nfc-emulate-forum-tag2.c example, it would be a great help if those files could be made available for all the mere mortals like me that can't get the stack to build on Windows.

It is a real shame that executables have never been uploaded or offered.  There are so many Windows users that would appreciate some compiled examples, but I have yet to see such a thing offered.

Re: libnfc for Beginners

Papyrus wrote:

I have been able to compile and build some previous versions such as 1.5.1 but I have had no luck with the latest release, all I get is error after error after error.

I've been contributing to fix the Windows build as of late. I'm not sure what steps your taking, but the windows build is fairly straight forward now. It's pretty much a click to compile via CMake. (Sure it's not visual studio, but given the gcc dependency, it's not bad!)

Papyrus wrote:

If some of the community members that know how to build libnfc 1.7.1 on Windows, particularly the nfc-emulate-forum-tag2.c example, it would be a great help if those files could be made available for all the mere mortals like me that can't get the stack to build on Windows.

It is a real shame that executables have never been uploaded or offered.  There are so many Windows users that would appreciate some compiled examples, but I have yet to see such a thing offered.

Well, during the 1.7.0 rc builds, there have been a couple of interim points where Windows simply didn't compile. I've been waiting to line up with a version as I'm not keen on voluntarily supporting something out of cycle with the main tree.

If you're simply waiting on a binary set to play with though, message me and I'll see about generating an interim package.

Re: libnfc for Beginners

Hi Alian,

Thanks for your response smile  This is super encouraging for me. 

Okay so the heart of the problem with my attempts to build 1.7.1 on Windows is the PCRE, as the files I've attempted to install and/or unzip have not played nice with the MinGW build. The readme file mentions nothing about the various folder options and what not as it assumes you know what to do with the it.

I won't bother you about these details as you mentioned that you're not keen on supporting a version out of cycle with the main tree, but I would love a binary set to play with.  If you could provide me those you would be my hero!  I'll message with you with the details about the hardware I'm using.

Re: libnfc for Beginners

Hi Alian,

I actually can't message you through this forum, so I'll just post my request here.  To contact me privately e-mail info@papyruselectronics.com.

I'm using the PN532 on a UART (serial demo board that connects to my PC's com port)

my OS is Windows XP.

I guess I would need the binaries (executables) and the required updated libnfc.dll for my system32 folder.


Any help you could offer would be great!