如何在 ubuntu 中编译 libmtp

如何在 ubuntu 中编译 libmtp

当我尝试编译 mtp 时,出现以下错误。请问我该如何解决?

Script started on Fri 23 May 2014 12:12:26 AM PDT
sansari@ubuntu:~/local/src/libmtp-1.1
.3$ sudo make
[sudo] password for sansari: 
make  all-recursive
make[1]: Entering directory `/home/sansari/local/src/libmtp-1.1.3'
Making all in src
make[2]: Entering directory `/home/sansari/local/src/libmtp-1.1.3/src'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/sansari/local/src/libmtp-1.1.3/src'
Making all in examples
make[2]: Entering directory `/home/sansari/local/src/libmtp-1.1.3/examples'
/bin/bash ../libtool --tag=CC   --mode=link gcc  -g -O2 -Wall -Wmissing-prototyp
es   -o mtp-connect connect.o delfile.o getfile.o newfolder.o sendfile.o sendtr.
o pathutils.o util.o ../src/libmtp.la 
libtool: link: gcc -g -O2 -Wall -Wmissing-prototypes -o .libs/mtp-connect connec
t.o delfile.o getfile.o newfolder.o sendfile.o sendtr.o pathutils.o util.o  ../s
rc/.libs/libmtp.so
../src/.libs/libmtp.so: undefined reference to `get_usb_device_timeout'
../src/.libs/libmtp.so: undefined reference to `LIBMTP_Detect_Raw_Devices'
../src/.libs/libmtp.so: undefined reference to `get_playlist_extension'
../src/.libs/libmtp.so: undefined reference to `ptp_usb_event_wait'
../src/.libs/libmtp.so: undefined reference to `set_usb_device_timeout'
../src/.libs/libmtp.so: undefined reference to `guess_usb_speed'
../src/.libs/libmtp.so: undefined reference to `configure_usb_device'
../src/.libs/libmtp.so: undefined reference to `dump_usbinfo'
../src/.libs/libmtp.so: undefined reference to `close_device'
collect2: ld returned 1 exit status
make[2]: *** [mtp-connect] Error 1
make[2]: Leaving directory `/home/sansari/local/src/libmtp-1.1.3/examples'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/sansari/local/src/libmtp-1.1.3'
make: *** [all] Error 2
sansari@ubuntu:~/local/src/libmtp-1.1
.3$ exit

Script done on Fri 23 May 2014 12:12:45 AM PDT

答案1

您不需要实现困难的编译方法来在 Ubuntu 中安装 Libmtp。

Libmtp 位于主 Ubuntu 存储库中,您可以按照以下命令安装它。

sudo apt-get install libmtp-common libmtp-dbg libmtp-dev libmtp-doc libmtp-runtime libmtp9 dpkg libc6 libusb-1.0-0 

相关内容