简体   繁体   English

编译libgphoto2时出现问题

[英]Problems while compiling libgphoto2

I am trying to get the latest version of libgphoto2 (2.5.12) and gphoto2 (2.5.11) to work on Debian Jessie. 我正在尝试获取最新版本的libgphoto2(2.5.12)和gphoto2(2.5.11)来在Debian Jessie上工作。 I downloaded and extracted the source files from git and followed the install instructions: 我从git下载并提取了源文件,并按照安装说明进行了操作:

autoreconf --install --symlink
./configure --prefix=/usr/local

Configure worked without any major issues. 配置工作正常,没有任何重大问题。 The only thing I noticed is that it mentions "libusb-1.0 no" but "libusb yes". 我唯一注意到的是它提到“ libusb-1.0否”但提到“ libusb是”。 I tried reinstalling libusb-1.0-0(-dev), but no change. 我尝试重新安装libusb-1.0-0(-dev),但没有更改。

The following is an excerpt of the make output: 以下是make输出的摘录:

make[4]: Entering directory '/home/max/Downloads/libgphoto2-2.5.12/libgphoto2_port'
/bin/bash ./libtool  --tag=CC   --mode=link gcc  -g -O2 -Wall -Wmissing-declarations -Wmissing-prototypes -module -no-undefined -avoid-version -export-dynamic -export-symbols ./iolib.sym -rpath '/usr/local/lib/libgphoto2_port/0.12.0'  -o usb1.la  libusb1/usb1_la-libusb1.lo ./libgphoto2_port/libgphoto2_port.la -L/usr/local/lib -lusb-1.0   -lpthread 
libtool: link: rm -fr  .libs/usb1.ver
libtool: link: echo "{ global:" > .libs/usb1.ver
libtool: link:  cat ./iolib.sym | sed -e "s/\(.*\)/\1;/" >> .libs/usb1.ver
libtool: link:  echo "local: *; };" >> .libs/usb1.ver
libtool: link:  gcc -shared  -fPIC -DPIC  libusb1/.libs/usb1_la-libusb1.o   -Wl,-rpath -Wl,/home/max/Downloads/libgphoto2-2.5.12/libgphoto2_port/libgphoto2_port/.libs ./libgphoto2_port/.libs/libgphoto2_port.so -L/usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libltdl.so -ldl -L/usr/local/lib /usr/local/lib/libusb-1.0.a -ludev -lpthread  -g -O2   -pthread -Wl,-soname -Wl,usb1.so -Wl,-version-script -Wl,.libs/usb1.ver -o .libs/usb1.so
/usr/bin/ld: /usr/local/lib/libusb-1.0.a(libusb_1_0_la-core.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libusb-1.0.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:820: recipe for target 'usb1.la' failed
make[4]: *** [usb1.la] Error 1

...and make stops. ...然后停下来。 I simply don't know what to do as "-fPIC" is mentioned in the gcc options. 我根本不知道该怎么办,因为gcc选项中提到了“ -fPIC”。

If I can give you further information, please let me know. 如果我可以为您提供更多信息,请告诉我。

I solved this problem by manually compiling and installing a new version of libusb1. 我通过手动编译并安装新版本的libusb1解决了此问题。 Download it from here , then just configure, make and install as described in the instructions. 这里下载它,然后按照说明进行配置,制造和安装。 At least for me it worked. 至少对我来说,它有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM