example software host application compiler problem

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
KK

example software host application compiler problem

Post by KK » Sat Oct 16, 2010 2:31 pm

Hi all,

I have trouble compiling the host software on a 64 bit Windows 7 system.

I downloaded MinGW installer package and installed it, I had to manualy add the path variable to be able to compile from a Programmers Notepad project. No problem there ...

Then i received messages about not being able to find the usb.h file from the libusb-win32 download so I copied the header file from the ../include directory in to the ../commandline directory and changed the include statement from <usb.h> to "usb.h".

When I try to compile I get:

Code: Select all

> "make.exe" -f Makefile.windows
gcc -o set-led.exe opendevice.o set-led.o -L/MinGW/lib/libusb
opendevice.o: In function `usbGetStringAscii':
..\custom-class\commandline/opendevice.c:91: undefined reference to `usb_get_string_simple'
..\custom-class\commandline/opendevice.c:93: undefined reference to `usb_control_msg'
opendevice.o: In function `usbOpenDevice':
..\custom-class\commandline/opendevice.c:123: undefined reference to `usb_find_busses'
..\custom-class\commandline/opendevice.c:124: undefined reference to `usb_find_devices'
..\custom-class\commandline/opendevice.c:125: undefined reference to `usb_get_busses'
..\custom-class\commandline/opendevice.c:131: undefined reference to `usb_open'
..\custom-class\commandline/opendevice.c:135: undefined reference to `usb_strerror'
..\custom-class\commandline/opendevice.c:146: undefined reference to `usb_strerror'
..\custom-class\commandline/opendevice.c:158: undefined reference to `usb_strerror'
..\custom-class\commandline/opendevice.c:170: undefined reference to `usb_strerror'
..\custom-class\commandline/opendevice.c:187: undefined reference to `usb_close'
set-led.o: In function `main':
..\custom-class\commandline/set-led.c:49: undefined reference to `usb_init'
..\custom-class\commandline/set-led.c:88: undefined reference to `usb_control_msg'
..\custom-class\commandline/set-led.c:91: undefined reference to `usb_strerror'
..\custom-class\commandline/set-led.c:99: undefined reference to `usb_control_msg'
..\custom-class\commandline/set-led.c:101: undefined reference to `usb_strerror'
..\custom-class\commandline/set-led.c:136: undefined reference to `usb_close'
collect2: ld returned 1 exit status


What am I doing wrong? Thanks for any input.

Koen.

jay.elle
Posts: 13
Joined: Tue Aug 17, 2010 11:12 am

Re: example software host application compiler problem

Post by jay.elle » Sat Oct 16, 2010 5:19 pm

Are you using the legacy API(libusb .1)? I had compile errors when i used the stable 1.0

KK

Re: example software host application compiler problem

Post by KK » Sat Oct 16, 2010 5:25 pm

I 'm not sure what you mean when you write about the legacy .1. I 'm using the libusb-win32-bin-1.2.2.0 distribution. Should it perhaps be located in the MinGW directory, because that isn't the case right now?

Koen.

jay.elle
Posts: 13
Joined: Tue Aug 17, 2010 11:12 am

Re: example software host application compiler problem

Post by jay.elle » Sat Oct 16, 2010 9:55 pm

i'm a noob and i don't use windows so i can't be of more help, but try this:

viewtopic.php?f=8&t=4749&p=15603&hilit=compile#p15603

Guest

Re: example software host application compiler problem

Post by Guest » Sun Oct 17, 2010 11:02 am

Mmmm ... Been there done that still get the undefined reference problem. This must be a Windows 7 related problem. The controller firmware gets recognized by Windows, the driver gets loaded ... But I'm unable to compile (better link) the host application.

Koen.

KK

Re: example software host application compiler problem

Post by KK » Sun Oct 17, 2010 2:04 pm

Problem solved, I made a little typo in the makefile.Windows -lusb.

Thanks all.

Koen

Post Reply