3

我在 Debian Jessie 8.10 amd64 上创建了一个 c++ 应用程序,它还需要以下库:

sudo apt-get install libssl-dev
sudo apt-get install libcurl4-openssl-dev

我还需要交叉编译 armhf 的源代码。因此,根据这个非常有用的链接https://wiki.embeddedarm.com/wiki/Jessie_armhf_Cross_Compile我给出了以下命令:

sudo apt-get install curl build-essential
su root
echo "deb http://emdebian.org/tools/debian jessie main" > 
/etc/apt/sources.list.d/emdebian.list
curl http://emdebian.org/tools/debian/emdebian-toolchain-archive.key | apt-key add -
dpkg --add-architecture armhf
apt-get update
apt-get install crossbuild-essential-armhf

一切都正确安装,然后我也给了:

 sudo apt-get install libssl-dev:armhf
 sudo apt-get install libcurl4-openssl-dev:armhf

第一个命令执行成功。另一方面,第二个失败给出以下输出:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
libcurl4-doc:armhf libcurl3-dbg:armhf libidn11-dev:armhf libkrb5-dev:armhf libldap2-dev:armhf
librtmp-dev:armhf libssh2-1-dev:armhf pkg-config:armhf
The following NEW packages will be installed:
libcurl4-openssl-dev:armhf
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
23 not fully installed or removed.
Need to get 0 B/316 kB of archives.
After this operation, 863 kB of additional disk space will be used.
(Reading database ... 94032 files and directories currently installed.)
Preparing to unpack .../libcurl4-openssl-dev_7.38.0-4+deb8u8_armhf.deb ...
Unpacking libcurl4-openssl-dev:armhf (7.38.0-4+deb8u8) ...
dpkg: error processing archive /var/cache/apt/archives/libcurl4-openssl-dev_7.38.0-4+deb8u8_armhf.deb (--unpack):
 trying to overwrite shared '/usr/include/curl/curlbuild.h', which is different from other instances of package libcurl4-openssl-dev:armhf
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Processing triggers for man-db (2.7.0.2-5) ...
Errors were encountered while processing:
 /var/cache/apt/archives/libcurl4-openssl-dev_7.38.0-4+deb8u8_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

由于我在交叉编译过程中很新,有人知道我做错了什么吗?

4

1 回答 1

0

你没有做错什么。这是与多架构软件包相关的文件冲突。这是包中的一个错误

这是对这种错误的解释,来自https://wiki.debian.org/MultiArch/Hints

有问题的包被标记为 Multi-Arch: same,但对于不同的体系结构,至少一个文件的版本存在冲突。提示告诉文件名(或文件名的数量)和有问题的体系结构(或体系结构的数量)。最简单的修复方法是删除 Multi-Arch: same 声明,但通常可以通过将有问题的文件移动到每个架构位置(通常是 /usr/lib/$(DEB_HOST_MULTIARCH)/)来修复它。对于 *-dev 包,Multi-Arch: same 功能通常并不重要,删除是一个很好的初始措施。

我只是遇到了同样的问题,这仍然是某些软件包的问题。就我而言, libcurl-openssl-dev正在替换/usr/bin/curl-config二进制文件。

对我来说,当我需要交叉编译时,它需要从 x64/i386 库中进行交换,但我很清楚这对每个人来说可能都不可能。

于 2019-07-09T09:53:44.087 回答