Topic: Libusb are missing header files on MacOS Lion

OS:
Mac OSX 10.7.1, Lion

Hi there. I am trying to setup libnfc in order to get nfOSC to work and I'm running into some problems trying to configure libnfc.

I have downloaded MacPorts and done all the installations needed here: http://www.libnfc.org/documentation/ins … .#mac_os_x

$ sudo port install glib
didnt work, but i have glib2 and tried with

$ sudo port install glib1
instead, so now i can see that i have both glib1+2

$ lipo -info /usr/local/lib/libusb.dylib
didn't work either but i somehow got to see that i have the right version (don't remember how)

When i try to do:

$ sudo ./configure
in the libnfc folder i get the following:

configure: error: The libusb headers are missing

I have tried installing both libusb-1.0.8 and libusb-0.1.12 manually but nothing solved the problem.

Can anyone come up with an answer to help me?

Re: Libusb are missing header files on MacOS Lion

Hello,

Try to install libusb-legacy package:

sudo port install libusb-legacy

And please give us some feedback smile

Romuald Conty

Re: Libusb are missing header files on MacOS Lion

Thank you very much. It works with:

$ nfc-list

I still get some errors i can't wrap my head around though. I have 3 x ACR122 readers connected, and when i run

$ nfc-list

and no RFID is placed on the first reader but on the 2 others, the script stops and i dont get any information on whats on the others. When i have a 1 on the first, none on the second, and 1 on the third. I get from the first, and not the third. Is your script just to test? And do i then need to write my own script to avoid this?

Further questions:
I'm trying to compile your example with:

$ gcc libnfc_example.c -o libnfc_example -lnfc

and i get this back:

libnfc_example.c: In function ‘main’:
libnfc_example.c:39: error: ‘PM_ISO14443A_106’ undeclared (first use in this function)
libnfc_example.c:39: error: (Each undeclared identifier is reported only once
libnfc_example.c:39: error: for each function it appears in.)
libnfc_example.c:39: warning: passing argument 5 of ‘nfc_initiator_select_passive_target’ from incompatible pointer type

Any idea of what this is?

Some feedback:
- I found it very hard to find information on how to fix these problems by my own, and that i actually needed something else than what was listed in your installation makes wonder if it needs some adjustments. Just a thought.

- And last but not least. Thank you for the quick answer and an amazing job putting this together. I am working on a school project for an exhibition and you have definitely made my job a lot easier, even though i have a hard time wrapping my head around all of this.

Re: Libusb are missing header files on MacOS Lion

By the way:
- I cant locate either /etc/libccid_Info.plist or /usr/lib/pcsc/drivers/ifd-acsccid.bundle/Contents/Info.plist for changing the CCID Exchange command.

Re: Libusb are missing header files on MacOS Lion

Hello,

dnlmzw wrote:

I still get some errors i can't wrap my head around though. I have 3 x ACR122 readers connected, and when i run

$ nfc-list

and no RFID is placed on the first reader but on the 2 others, the script stops and i dont get any information on whats on the others. When i have a 1 on the first, none on the second, and 1 on the third. I get from the first, and not the third. Is your script just to test? And do i then need to write my own script to avoid this?

I will have to dig the problem tomorrow.
I wrote your problem in our issue tracker to keep a clean track of your experiment.
http://code.google.com/p/libnfc/issues/detail?id=177


dnlmzw wrote:
$ gcc libnfc_example.c -o libnfc_example -lnfc

and i get this back:

libnfc_example.c: In function ‘main’:
libnfc_example.c:39: error: ‘PM_ISO14443A_106’ undeclared (first use in this function)
libnfc_example.c:39: error: (Each undeclared identifier is reported only once
libnfc_example.c:39: error: for each function it appears in.)
libnfc_example.c:39: warning: passing argument 5 of ‘nfc_initiator_select_passive_target’ from incompatible pointer type

It seems to be a code extracted from quick_start_example1.c, right ?
This example is not build during "make distcheck" process so we always forgot to upgrade it.
Sorry about that, I have made the requiered changes to it. Now it works:
http://code.google.com/p/libnfc/source/detail?r=1178

dnlmzw wrote:

Some feedback:
- I found it very hard to find information on how to fix these problems by my own, and that i actually needed something else than what was listed in your installation makes wonder if it needs some adjustments. Just a thought.

I agreed, some are my fault some may need more documentation... Do you what is exactly missing to you ? Could you point us out a improvement we can made to ease new developers to use libnfc ? Do you have any example project that does this guidance as you wish to have ?

dnlmzw wrote:

- And last but not least. Thank you for the quick answer and an amazing job putting this together. I am working on a school project for an exhibition and you have definitely made my job a lot easier, even though i have a hard time wrapping my head around all of this.

Thank you!...

Romuald Conty

Re: Libusb are missing header files on MacOS Lion

rconty wrote:

I will have to dig the problem tomorrow.
I wrote your problem in our issue tracker to keep a clean track of your experiment.
http://code.google.com/p/libnfc/issues/detail?id=177

It probably has to do what i wrote in my last message. I saw another guy talking about this issue here:
[SOLVED] Problem with nfc_connect using ACR122/Touchatag

I have problems locating the file as i said. I have downloaded configured and done make install on pcsc-lite-1.7.4 without any errors, but for some reason the "libccid_Info.plist" or "Info.plist" is not showing up in the folders they're supposed to. Do you have any knowledge on where i could find some forums / help addressing problems in PCSC?

rconty wrote:

It seems to be a code extracted from quick_start_example1.c, right ?

Yes! And this works now. But it is making the same error as:

$ nfc-list

with not detecting other readers if the first one doesn't have a RFID near by. It is probably the same error that i talked about earlier.

My initial idea was to work with nfOSC but i guess that won't work either until i address the errors I'm currently having.

rconty wrote:

Do you have any example project that does this guidance as you wish to have ?

Well for me it was all about learning new stuff. I didnt have any idea on how to work with this technology, but since our idea was already settled upon i had to use the technology and libraries out there. Going from top to bottom (Beggining with nfOSC) i had to get all the different libraries and make them work seperately. I have 5 years of of ActionScript and PHP experience but have never worked that much in terminal. I'm not saying that you have to learn me how the terminal works, just that when i got errors in other libraries (pkgconfig, glib, libusb, macports), i didn't have any idea on where to look for answers and wether i would actually succeed. An FAQ on things that have gone wrong for others or a better specified step-by-step guide would probably have helped me a lot.

Thanks again for your help!

Apreciated.

Re: Libusb are missing header files on MacOS Lion

I have tried to reinstall the pcsc-lite a couple of times without any luck. The folders where libccid_Info.plist or Info.plist files should be installed to is simple not showing of. Where in the installation can i find out where they're being moved to? And do you have any idea about wether or not that should solve my problem detecting more than 1 readers?

Re: Libusb are missing header files on MacOS Lion

I just tried with 2 ACR122 devices:

- ACS ACR 38U-CCID 01 00 / ACR122U102 - PN532 v1.4 (0x07) --> Touchatag
- ACS ACR122U PICC Interface 00 00 / ACR122U205 - PN532 v1.4 (0x07) --> ACR122 from ACS

nfc-list works after setting ifdDriverOptions (/etc/libccid_Info.plist) to 0x0005 value.

This is explained in README file in Troubleshooting section, but you already have the information.

Unfortunatly I don't know where this file is located under Mac OS X.

Romuald Conty

Re: Libusb are missing header files on MacOS Lion

What OS are you running? I'm thinking about installing that one and make it to work through that way!

Re: Libusb are missing header files on MacOS Lion

Hi,

I made these tests under Ubuntu (11.04) but should work the same under many Linux based OSes and FreeBSD.

BTW, since r1179 it should have a different behaviour using nfc-list but devices that do not work will not after this revision.

I pretty sure the problem comes from bogus ACR122 detection that need some customs options for PCSC, but I can't help you to find the right file.

Maybe you could try on pcsc-lite mailing list ? Mac OS X is provided with a custom version of pcsc-lite, AFAIK.

Romuald Conty

Re: Libusb are missing header files on MacOS Lion

If I remember correctly, you can find that file in /usr/libexec/SmartCardServices/drivers/ifd-ccid.bundle/Contents/Info.plist under Mac OS X - but keep in mind that Apple have deprecated Smartcard Services (and CDSA) in 10.7, and may remove it in the future.

I hope that helps.

Last edited by tyson.key (2011-10-28 12:42:34)