mkorenkov / ipad_charge

charge Apple devices under Ubuntu Linux
GNU General Public License v2.0
258 stars 72 forks source link

ipadcharge build failure Debian Wheezy #39

Open kirrus opened 9 years ago

kirrus commented 9 years ago

Hi,

The changes in commit bb24e1c3a79016cfdffb9d28189485766d655ec6 cause compilation to fail on Debian Wheezy;

kirrus@MrsCake:~/development/ipad_charge$ make
gcc -Wall -Wextra ipad_charge.c -lusb-1.0 -o ipad_charge
ipad_charge.c: In function ‘set_charging_mode’:
ipad_charge.c:38:3: warning: implicit declaration of function ‘libusb_strerror’ [-Wimplicit-function-declaration]
ipad_charge.c:38:3: warning: format ‘%s’ expects argument of type ‘char *’, but argument 3 has type ‘int’ [-Wformat]
ipad_charge.c:44:3: warning: format ‘%s’ expects argument of type ‘char *’, but argument 3 has type ‘int’ [-Wformat]
ipad_charge.c:54:3: warning: format ‘%s’ expects argument of type ‘char *’, but argument 3 has type ‘int’ [-Wformat]
ipad_charge.c: In function ‘main’:
ipad_charge.c:153:5: warning: format ‘%s’ expects argument of type ‘char *’, but argument 3 has type ‘int’ [-Wformat]
/tmp/cc3F3dOB.o: In function `set_charging_mode':
ipad_charge.c:(.text+0x54): undefined reference to `libusb_strerror'
ipad_charge.c:(.text+0xbc): undefined reference to `libusb_strerror'
ipad_charge.c:(.text+0x152): undefined reference to `libusb_strerror'
/tmp/cc3F3dOB.o: In function `main':
ipad_charge.c:(.text+0x528): undefined reference to `libusb_strerror'
collect2: error: ld returned 1 exit status  
make: *** [ipad_charge] Error 1

Building from 3088ebaffe8a8c5b8f743010aa902dde87208cf2 succeeded.

kirrus commented 9 years ago

The libusb packages I have installed:

ii  libusb-0.1-4:amd64                       2:0.1.12-20+nmu1                   amd64        userspace USB programming library
ii  libusb-1.0-0:amd64                       2:1.0.11-1                         amd64        userspace USB programming library
ii  libusb-1.0-0-dev                         2:1.0.11-1                         amd64        userspace USB programming library development files
ii  libusb-dev                               2:0.1.12-20+nmu1                   amd64        userspace USB programming
xmlyqing00 commented 8 years ago

I think you could remove the sentence including the "libusb_strerror" in the C file and try again