小编Mar*_*gan的帖子

为 arm-linux 交叉编译时加载共享库 libz.so.1 时出错

我正在尝试在 Ubuntu 14.04 上交叉编译一个 opencv 应用程序以在 ARM 内核上运行。我可以在 Ubuntu 上用

g++ test.c -o test -I /usr/include/opencv -I /usr/include/opencv2 -L /usr/local/lib/ -lopencv_core -lopencv_imgproc -lopencv_highgui
Run Code Online (Sandbox Code Playgroud)

它编译,我的目录中有一个 testl.bin。

但是,当我为我的 arm 核心更改编译器时

arm-linux-gnueabi-g++ test.c -o test -I /usr/include/opencv -I /usr/include/opencv2 -L /usr/local/lib/ -lopencv_core -lopencv_imgproc -lopencv_highgui
Run Code Online (Sandbox Code Playgroud)

我遇到了错误

error while loading shared libraries: libz.so.1: cannot open shared object file: no such file or directory.
Run Code Online (Sandbox Code Playgroud)

当我尝试安装这个库时 apt-get 让我知道它是最新版本并且不需要安装任何东西。

有人可以帮我吗?

shared-library compiling gcc arm cross-compilation

5
推荐指数
2
解决办法
4万
查看次数

标签 统计

arm ×1

compiling ×1

cross-compilation ×1

gcc ×1

shared-library ×1