Linker error in Android Studio while compiling NDK project -
i trying build ndk project android studio 2.3, ndk integrated it, gradle 3.3, using shared libraries(which come ndk , present in device), , these shared libs listed in cmakelists.txt on doing "clean project" gradle done no error,
8:36 pm gradle sync started 8:37 pm gradle sync completed 8:37 pm executing tasks: [:app:generatedebugsources,:app:generatedebugandroidtestsources, :app:mockableandroidjar, :app:preparedebugunittestdependencies] 8:37 pm gradle build finished in 12s 541ms
but on running project gives linker error.
> build command failed. error while executing process c:\users\user\appdata\local\android\sdk\cmake\3.6.4111459\bin\cmake.exe arguments {--build f:\studioprj\aaudio\app\.externalnativebuild\cmake\debug\mips64 --target native-lib} [1/1] linking cxx shared library ..\..\..\..\build\intermediates\cmake\debug\obj\mips64\libnative-lib.so failed: cmd.exe /c "cd . && c:\users\user\appdata\local\android\sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=mips64el-none-linux-android --gcc-toolchain=c:/users/user/appdata/local/android/sdk/ndk-bundle/toolchains/mips64el-linux-android-4.9/prebuilt/windows-x86_64 --sysroot=c:/users/user/appdata/local/android/sdk/ndk-bundle/sysroot -fpic -isystem c:/users/user/appdata/local/android/sdk/ndk-bundle/sysroot/usr/include/mips64el-linux-android -d__android_api__=24 -g -dandroid -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fintegrated-as -wa,--noexecstack -wformat -werror=format-security -frtti -fexceptions -std=c++11 -wall -werror -o0 -fno-limit-debug-info -wl,--exclude-libs,libgcc.a --sysroot c:/users/user/appdata/local/android/sdk/ndk-bundle/platforms/android-24/arch-mips64 -wl,--build-id -wl,--warn-shared-textrel -wl,--fatal-warnings -wl,--no-undefined -wl,-z,noexecstack -qunused-arguments -wl,-z,relro -wl,-z,now -shared -wl,-soname,libnative-lib.so -o ..\..\..\..\build\intermediates\cmake\debug\obj\mips64\libnative-lib.so cmakefiles/native-lib.dir/src/main/cpp/native-lib.cpp.o cmakefiles/native-lib.dir/src/main/cpp/aaudioimp.cpp.o -laaudio -llog -latomic -landroid -lm "c:/users/user/appdata/local/android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/mips64/libgnustl_static.a" && cd ." c:/users/user/appdata/local/android/sdk/ndk-bundle/toolchains/mips64el-linux-android-4.9/prebuilt/windows-x86_64/lib/gcc/mips64el-linux-android/4.9.x/../../../../mips64el-linux-android/bin\ld: cannot find -laaudio clang++.exe: error: linker command failed exit code 1 (use -v see invocation)
from errors, seems toolchains can't link libaaudio, have used 1 header file in code coming .so this
#include <aaudio/aaudio.h>
also ndk showing me available options module, don't think .so not linked project. confirm more libaaudio present @ these paths(this lib comes ndk package)
c:\users\user\appdata\local\android\sdk\ndk-bundle\platforms\android-26\arch-arm\usr\lib c:\users\user\appdata\local\android\sdk\ndk-bundle\platforms\android-26\arch-arm64\usr\lib c:\users\user\appdata\local\android\sdk\ndk-bundle\platforms\android-26\arch-mips\usr\lib c:\users\user\appdata\local\android\sdk\ndk-bundle\platforms\android-26\arch-mips64\usr\lib c:\users\user\appdata\local\android\sdk\ndk-bundle\platforms\android-26\arch-x86\usr\lib c:\users\user\appdata\local\android\sdk\ndk-bundle\platforms\android-26\arch-x86_64\usr\lib
--sysroot c:/users/user/appdata/local/android/sdk/ndk-bundle/platforms/android-24/arch-mips64
you're targeting android-24, , aaudio isn't available until android-26.
Comments
Post a Comment