Reputation: 1800
I try to compile my project with native c-libs and get next error
/Users/eugene/KREF14001/app/src/main/jni/libC/PulseFilter.c: In function 'shapeMonoGame':
/Users/eugene/KREF14001/app/src/main/jni/libC/PulseFilter.c:696:5: error: 'for' loop initial declarations are only allowed in C99 mode
/Users/eugene/KREF14001/app/src/main/jni/libC/PulseFilter.c:696:5: note: use option -std=c99 or -std=gnu99 to compile your code
From this report I find that I must to use option -std=c99 or -std=gnu99 to compile my code, but I don't know how to do it. Please, help me.
Upvotes: 3
Views: 1111
Reputation: 1994
In the build.gradle
file of your app, you can add cFlags "-std=c99"
in the ndk
block located within the defaultConfig
block like this:
ndk {
moduleName "libblur"
abiFilter "armeabi-v7a"
stl "gnustl_static"
cFlags "-std=c99"
ldLibs "log"
}
Upvotes: 3
Reputation: 1800
The problem was in that the Gradle don't use your .mk files, but generate its own and use them. So it's useful to edit Android.mk and Application.mk. You can build your source code manually or edit ndk section of build.gradle.
Upvotes: 2