Problem building commandline examples on OS X

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
rocross
Posts: 1
Joined: Sat Apr 23, 2011 10:11 pm

Problem building commandline examples on OS X

Post by rocross » Sat Apr 23, 2011 10:16 pm

Hi,

first i wanted to thank the developers for this great software!

I tried building the hid-data example. Everything concerning the firmware worked fine, but compiling the commandline application on an OS X 10.6 didn't work. I installed libusb 1.0.8 and couldn't find the libusb-config file. This file also was not created when installing libusb 1.0.6 or libusb-devel via macports. After several days of research i couldn't figure out what to do in order to get the files compiled.

When calling "make", i always get:

gcc `libusb-config --cflags` -O -g -Wall -c opendevice.c
/bin/sh: libusb-config: command not found
In file included from opendevice.c:18:
opendevice.h:26:77: error: usb.h: No such file or directory
In file included from opendevice.c:18:
opendevice.h:29: error: expected ‘)’ before ‘*’ token
opendevice.h:40: error: expected ‘)’ before ‘*’ token
opendevice.c:86: error: expected ‘)’ before ‘*’ token
opendevice.c:116: error: expected ‘)’ before ‘*’ token
make: *** [opendevice.o] Error 1


I even tried to find the necessary files that have to be included by hand and to include them, which didn't work out either. Was anyone able to build the commandline examples on an os x? And if, what could i do to overcome those problems?

Thanks a lot in advance, best regards,
Roman

jamesotron
Posts: 5
Joined: Fri May 13, 2011 12:31 am

Re: Problem building commandline examples on OS X

Post by jamesotron » Fri May 13, 2011 2:51 am

Hi there.

Probably the easiest and fastest way to get a working AVR development environment on the Mac is to just download the Arduino IDE and add the following to your .bashrc

Code: Select all

if [ -d /Applications/Arduino.app ]; then
  export PATH="$PATH:/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin"
fi


this will get you avr-gcc, avrdude, etc.

Daid
Rank 2
Rank 2
Posts: 55
Joined: Mon Apr 18, 2011 12:19 pm

Re: Problem building commandline examples on OS X

Post by Daid » Mon May 16, 2011 6:11 pm

@jamesotron: And his question had nothing to do with avr-gcc.

Roman,
Most likely MacOS libusb does not ship with "libusb-config" tool. You'll need to edit the Makefile so gcc can find the usb.h file and libusb.so file. Instead of "`libusb-config --cflags`" you'll need to add something like "-I/usr/include/libusb/" (I don't own MacOS so I don't know the paths)

arikiki-arikikiki
Posts: 1
Joined: Fri May 20, 2011 10:02 pm

Re: Problem building commandline examples on OS X

Post by arikiki-arikikiki » Fri May 20, 2011 10:07 pm

Roman, any success in building a host application? Does it require xCode?
What bothers me most of all is the question if I need to install any other files but for the host app for it to run on the destination (not developer's) machine?

Post Reply