I'm running gradlew to compile an Android app that has a static lib dependency. Somehow, I have an undefined reference to bsd_signal . I was able to compile this app with gradle 1.X, but I've been obliged to switch to gradle 2.10 and to drop my Android.mk file in favour of putting more build instruction into my gradle.build file, and this is where the trouble arises. Can anyone tell me whether there is a library that defines bsd_signal , which I should link to my project? Compiler output
Starting process 'command '/home/myself/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++''. Working directory: /home/myself/projects/DroidEar/app Command: /home/myself/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ @/home/myself/projects/DroidEar/app/build/tmp/linkNativeArmeabi-v7aDebugSharedLibrary/options.txt Successfully started process 'command '/home/myself/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++'' /android/ndk/platforms/android-9/arch-arm/usr/include/signal.h:113: error: undefined reference to 'bsd_signal' /android/ndk/platforms/android-9/arch-arm/usr/include/signal.h:113: error: undefined reference to 'bsd_signal' collect2: error: ld returned 1 exit status
TMI: Here is my gradle.build file
apply plugin: 'com.android.model.application' model < repositories < libs(PrebuiltLibraries) < Superpowered < binaries.withType(StaticLibraryBinary) < def prefix = "src/main/jniLibs/Superpowered" headers.srcDir "$" if (targetPlatform.getName() == "armeabi-v7a") staticLibraryFile = file("$/libSuperpoweredAndroidARM.a") else if (targetPlatform.getName() == "arm64-v8a") staticLibraryFile = file("$/libSuperpoweredAndroidARM64.a") else if (targetPlatform.getName() == "x86_64") staticLibraryFile = file("$/libSuperpoweredAndroidX86_64.a") else if (targetPlatform.getName() == "X86") staticLibraryFile = file("$/libSuperpoweredAndroidX86.a") > > > > android < compileSdkVersion = 23 buildToolsVersion = "23.0.3" sources < main < jni < dependencies < library "Superpowered" linkage "static" >> > > ndk < ldLibs.addAll(['log', 'android', 'c']) >defaultConfig < applicationId = "edu.ucdavis.auditoryenhancer" minSdkVersion.apiLevel = 22 targetSdkVersion.apiLevel = 23 versionCode = 1 versionName = "1.0" >> android.ndk < moduleName = "native" >android.buildTypes < release < minifyEnabled = false proguardFiles.add(file("proguard-rules.pro")) >> > dependencies
It looks to me like bsd_signal is defined in the signal.o component of platforms/android-9/arch-x86/usr/lib/libc.a , but even with my ldLibs call above including c , I get the error.