gpt4 book ai didi

android - android gradle plugin 1.4 beta ndk clang

转载 作者:行者123 更新时间:2023-12-03 06:14:57 26 4
gpt4 key购买 nike

下面是我的build.gradle。构建失败,原因是函数“管道”的隐式声明在C99中无效[-Wimplicit-function-declaration]
如果(-1 == pipe(ctx-> control_pipe)){
^
应用插件:“com.android.model.application”

model {
android {
compileSdkVersion = 21
buildToolsVersion = "21.1.2"

defaultConfig.with {
applicationId = "org.shadowvpn.shadowvpn"
minSdkVersion.apiLevel = 15
targetSdkVersion.apiLevel = 21
versionCode = 1
versionName = "1.0"
}
}
android.buildTypes {
release {
isMinifyEnabled = false
proguardFiles += file('proguard-rules.pro')
}
}
android.ndk {
moduleName = "ShadowVPN-jni"
toolchain = "clang"
toolchainVersion = "3.6"
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_aead/chacha20poly1305/sodium")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_auth/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_auth/hmacsha256/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_auth/hmacsha256/cp/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_auth/hmacsha512/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_auth/hmacsha512/cp/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_auth/hmacsha512256/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_auth/hmacsha512256/cp/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_box/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_core/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_core/hsalsa20/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_core/hsalsa20/ref2/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_core/salsa20/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_core/salsa20/ref/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_core/salsa2012/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_core/salsa2012/ref/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_core/salsa208/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_core/salsa208/ref/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_generichash/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_generichash/blake2/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_generichash/blake2/ref/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_hash/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_hash/sha256/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_hash/sha256/cp/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_hash/sha512/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_hash/sha512/cp/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_onetimeauth/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_onetimeauth/poly1305/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_pwhash/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/sse/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_scalarmult/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_scalarmult/curve25519/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_scalarmult/curve25519/donna_c64/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_secretbox/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/ref/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_shorthash/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_shorthash/siphash24/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_shorthash/siphash24/ref/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_sign/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_sign/ed25519/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_sign/ed25519/ref10/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_stream/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_stream/aes128ctr/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_stream/chacha20/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_stream/chacha20/ref/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_stream/salsa20/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_stream/salsa20/amd64_xmm6/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_stream/salsa20/ref/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_verify/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_verify/16/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_verify/16/ref/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_verify/32/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_verify/32/ref/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_verify/64/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/crypto_verify/64/ref/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/include/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/include/sodium/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/randombytes/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/randombytes/salsa20/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/randombytes/sysrandom/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/libsodium/src/libsodium/sodium/")}".toString()
CFlags += "-I${file("src/main/jni/ShadowVPN/src")}".toString()
ldLibs += "log"
stl = "system"
}
}

错误日志:
compiling vpn.c successful.
/Users/shawn/Developer/github/ShadowVPNAndroid/mobile/src/main/jni/vpn.c:35:13: warning: implicit declaration of function 'pipe' is invalid in C99 [-Wimplicit-function-declaration]
if (-1 == pipe(ctx->control_pipe)) {
^
/Users/shawn/Developer/github/ShadowVPNAndroid/mobile/src/main/jni/vpn.c:47:5: warning: implicit declaration of function 'close' is invalid in C99 [-Wimplicit-function-declaration]
close(ctx->tun);
^
2 warnings generated.
compiling version.c failed.
/Users/shawn/Developer/github/ShadowVPNAndroid/mobile/src/main/jni/ShadowVPN/libsodium/src/libsodium/sodium/version.c:2:10: fatal error: 'version.h' file not found
#include "version.h"
^
1 error generated.

compiling aead_chacha20poly1305.c failed.
In file included from /Users/shawn/Developer/github/ShadowVPNAndroid/mobile/src/main/jni/ShadowVPN/libsodium/test/default/aead_chacha20poly1305.c:3:
In file included from /Users/shawn/Developer/github/ShadowVPNAndroid/mobile/src/main/jni/ShadowVPN/libsodium/test/default/cmptest.h:11:
/Users/shawn/Developer/github/ShadowVPNAndroid/mobile/src/main/jni/ShadowVPN/libsodium/src/libsodium/include/sodium.h:48:10: fatal error: 'sodium/version.h' file not found
#include "sodium/version.h"
^
1 error generated.

compiling auth.c failed.
In file included from /Users/shawn/Developer/github/ShadowVPNAndroid/mobile/src/main/jni/ShadowVPN/libsodium/test/default/auth.c:3:
In file included from /Users/shawn/Developer/github/ShadowVPNAndroid/mobile/src/main/jni/ShadowVPN/libsodium/test/default/cmptest.h:11:
/Users/shawn/Developer/github/ShadowVPNAndroid/mobile/src/main/jni/ShadowVPN/libsodium/src/libsodium/include/sodium.h:48:10: fatal error: 'sodium/version.h' file not found
#include "sodium/version.h"
^
1 error generated.

compiling auth2.c failed.
In file included from /Users/shawn/Developer/github/ShadowVPNAndroid/mobile/src/main/jni/ShadowVPN/libsodium/test/default/auth2.c:4:
In file included from /Users/shawn/Developer/github/ShadowVPNAndroid/mobile/src/main/jni/ShadowVPN/libsodium/test/default/cmptest.h:11:
/Users/shawn/Developer/github/ShadowVPNAndroid/mobile/src/main/jni/ShadowVPN/libsodium/src/libsodium/include/sodium.h:48:10: fatal error: 'sodium/version.h' file not found
#include "sodium/version.h"
^
1 error generated.

compiling utils.c successful.

compiling auth7.c failed.
In file included from /Users/shawn/Developer/github/ShadowVPNAndroid/mobile/src/main/jni/ShadowVPN/libsodium/test/default/auth7.c:3:
In file included from /Users/shawn/Developer/github/ShadowVPNAndroid/mobile/src/main/jni/ShadowVPN/libsodium/test/default/cmptest.h:11:
/Users/shawn/Developer/github/ShadowVPNAndroid/mobile/src/main/jni/ShadowVPN/libsodium/src/libsodium/include/sodium.h:48:10: fatal error: 'sodium/version.h' file not found
#include "sodium/version.h"
^
1 error generated.

最佳答案

您的构建不会因为pipe函数而失败,这是一个警告。由于编译器找不到version.h文件,因此构建失败。我猜想您缺少这些(许多)-I标志之一,尤其是该文件夹:/Users/shawn/Developer/github/ShadowVPNAndroid/mobile/src/main/jni/ShadowVPN/libsodium/src/libsodium/sodium/

关于android - android gradle plugin 1.4 beta ndk clang,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31678170/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com