Replies: 1 comment
-
Please see You can either download pre-built libs from us or use the colab notebook in the doc. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
请问下Windows 交叉编译Android 静态库有什么最佳方法或者文档吗
我按照https://github.com/k2-fsa/sherpa-onnx/blob/master/build-android-arm64-v8a.sh进行改造
`
`
会出现link errror
" C:\Program Files (x86)\Android\AndroidNDK\android-ndk-r23c\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe -c -fdiagnostics-format=msvc --gcc-toolchain="C:\Program Files (x86)\Android\AndroidNDK\android-ndk-r23c\toolchains\x86_64-4.9\prebuilt\windows-x86_64" -target "x86_64-none-linux-android1" --sysroot="C:\Program Files (x86)\Android\AndroidNDK\android-ndk-r23c\toolchains\llvm\prebuilt\windows-x86_64\sysroot" -isystem "C:\Program Files (x86)\Android\AndroidNDK\android-ndk-r23c\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\x86_64-linux-android" -isystem "C:\Program Files (x86)\Android\AndroidNDK\android-ndk-r23c\toolchains\llvm\prebuilt\windows-x86_64\lib64\clang\12.0.9\include" -isystem "C:\Program Files (x86)\Android\AndroidNDK\android-ndk-r23c\sources\android\support\include" -isystem "C:\Program Files (x86)\Android\AndroidNDK\android-ndk-r23c\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include" -I "C:\Program Files (x86)\Android\AndroidNDK\android-ndk-r23c\sources\cxx-stl\llvm-libc++\include" -I "C:\Program Files (x86)\Android\AndroidNDK\android-ndk-r23c\sources\cxx-stl\llvm-libc++abi\include" -I "C:\Program Files (x86)\Android\AndroidNDK\android-ndk-r23c\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include" -I "C:\Program Files (x86)\Android\AndroidNDK\android-ndk-r23c\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\x86_64-linux-android" -I "C:\Program Files (x86)\Android\AndroidNDK\android-ndk-r23c\sources\android\support\include" -I "C:\Program Files (x86)\Android\AndroidNDK\android-ndk-r23c\toolchains\llvm\prebuilt\windows-x86_64\lib64\clang\12.0.9\include" -gline-tables-only -o "cmTC_8b2f9.dir\Debug\testCCompiler.o" -Wall -O3 -fno-strict-aliasing -fomit-frame-pointer -fno-exceptions -ffunction-sections -fdata-sections -fstack-protector -fpic -fno-short-enums -D ANDROID_MIN_SDK_VERSION=1 -D NDEBUG -D ANDROID -D _FORTIFY_SOURCE=2 -D "CMAKE_INTDIR="Debug"" -x c -g -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wformat -Werror=format-security -fno-limit-debug-info "C:\LocalZikki\newSherpa\sherpa-onnx\build_android_static\build_android_static\CMakeFiles\CMakeScratch\TryCompile-xx6tj1\testCCompiler.c"
testCCompiler.c
Link:
C:\Program Files (x86)\Android\AndroidNDK\android-ndk-r23c\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe -fdiagnostics-format=msvc -o"cmTC_8b2f9.dir\Debug\cmTC_8b2f9." -Wl,-soname="cmTC_8b2f9." -Wl,-rpath-link="C:\Program Files (x86)\Android\AndroidNDK\android-ndk-r23c\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\lib\x86_64-linux-android" -Wl,-rpath-link="C:\Program Files (x86)\Android\AndroidNDK\android-ndk-r23c\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\lib\x86_64-linux-android\1" -Wl,-L"C:\Program Files (x86)\Android\AndroidNDK\android-ndk-r23c\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\lib\x86_64-linux-android" -Wl,-L"C:\Program Files (x86)\Android\AndroidNDK\android-ndk-r23c\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\lib\x86_64-linux-android\1" -Wl,-L"C:\Program Files (x86)\Android\AndroidNDK\android-ndk-r23c\toolchains\x86_64-4.9\prebuilt\windows-x86_64\lib\gcc\x86_64-linux-android\4.9.x" -Wl,-L"C:\Program Files (x86)\Android\AndroidNDK\android-ndk-r23c\sources\cxx-stl\llvm-libc++\libs\x86_64" -Wl,--no-undefined --gcc-toolchain="C:\Program Files (x86)\Android\AndroidNDK\android-ndk-r23c\toolchains\x86_64-4.9\prebuilt\windows-x86_64" -target "x86_64-none-linux-android1" --sysroot="C:\Program Files (x86)\Android\AndroidNDK\android-ndk-r23c\toolchains\llvm\prebuilt\windows-x86_64\sysroot" -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -shared -static-libstdc++ -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--fatal-warnings -Wl,--gc-sections -Wl,--no-undefined -Qunused-arguments -Wl,--gc-sections cmTC_8b2f9.dir\Debug\testCCompiler.o "-latomic" "-lm" -lc++_static -lc++abi -llog -landroid
ld: error: cannot open crtbegin_so.o: No such file or directory
ld: error: unable to find library -llog
ld: error: unable to find library -landroid
ld: error: cannot open crtend_so.o: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VC\v170\Application Type\Android\3.0\Android.Common.targets(125,5): error MSB6006: "clang.exe" exited with code 1. [C:\LocalZikki\newSherpa\sherpa-onnx\build_android_static\build_android_static\CMakeFiles\CMakeScratch\TryCompile-xx6tj1\cmTC_8b2f9.vcxproj]
Done Building Project "C:\LocalZikki\newSherpa\sherpa-onnx\build_android_static\build_android_static\CMakeFiles\CMakeScratch\TryCompile-xx6tj1\cmTC_8b2f9.vcxproj" (default targets) -- FAILED."
详细log
android_compile.log
Beta Was this translation helpful? Give feedback.
All reactions