win10 ubuntu 使用Android ndk 问题:clang-14: Exec format error

1.问题

手头没有ubuntu,打算用一个轻量级ubuntu 安装Android ndk编译c++程序,但是报错了,报错如下:

clang-14: cannot execute binary file: Exec format error

2.原因

在某些情况下,可以使用 patchelf 工具来更改ELF文件的解释器路径或修复二进制文件格式错误。例如,对于WSL安装的Ubuntu 22.04 64位上运行NDK中的clang-14

3.修复

可能需要运行以下命令:

复制代码
sudo apt install patchelf
patchelf --set-interpreter /lib64/ld-linux-x86-64.so.2 /mnt/d/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang-14
相关推荐
雨白2 小时前
指针与数组的核心机制
android
黄林晴7 小时前
Room 3.0 正式发布!包名彻底重构,KMP 成为核心主线
android·android jetpack
三少爷的鞋8 小时前
Kotlin 协程环境下的 DCL 懒加载:别把线程时代的经验直接搬过来
android
plainGeekDev8 小时前
Gson → kotlinx.serialization
android·java·kotlin
orion5718 小时前
Missing Semester Class1:course overview and introduction of shell
linux
CYY951 天前
Compose 入门篇
android·kotlin
用户120487221611 天前
Linux驱动编译与加载
linux·嵌入式
杉氧1 天前
Compose 时代的 MVI 架构:如何用单向数据流驱动复杂 UI?
android·架构·android jetpack
杉氧1 天前
Modifier 的艺术:为什么链式调用的顺序决定了UI 的生命周期?
android·架构·android jetpack