Android: error: use of undeclared identifier 'fseeko'
Android: error: use of undeclared identifier 'fseeko'
当我尝试使用其源代码在 Android 中构建一个 boost 库时,出现以下错误
release|armeabi-v7a : D:/Android/Sdk/ndk->bundle/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1\fstream:969:9:
release|armeabi-v7a : error: use of undeclared identifier 'fseeko'
release|armeabi-v7a : if (fseeko(__file_, __sp, SEEK_SET))
下面是我的 CMake
externalNativeBuild {
cmake {
cppFlags "-std=c++14 -frtti -fexceptions -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
arguments '-DANDROID_SDK_ROOT=D:/Android/Sdk'
arguments '-DANDROID_EMULATOR_AVD=PixelArm'
arguments '-DCMAKE_BUILD_TYPE=Debug'
arguments '-DZLIBS_DIR=' + zlib_dir_libs
arguments '-DZLIB_INC_DIR=' + zlib_dir_inc
arguments '-DANDROID_PLATFORM=android-21'
}
}
ndk {
// Specifies the ABI configurations of your native
// libraries Gradle should build and package with your APK.
// need to also have ~ boost binaries built for each abi specified here
// abiFilters 'armeabi-v7a', 'x86', 'x86_64', 'arm64-v8a'
abiFilters 'armeabi-v7a'
}
fseeko64
在 android-24 之前不可用。您必须提高 minSdkVersion
或停止使用 _FILE_OFFSET_BITS=64
.
当我尝试使用其源代码在 Android 中构建一个 boost 库时,出现以下错误
release|armeabi-v7a : D:/Android/Sdk/ndk->bundle/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1\fstream:969:9: release|armeabi-v7a : error: use of undeclared identifier 'fseeko' release|armeabi-v7a : if (fseeko(__file_, __sp, SEEK_SET))
下面是我的 CMake
externalNativeBuild {
cmake {
cppFlags "-std=c++14 -frtti -fexceptions -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
arguments '-DANDROID_SDK_ROOT=D:/Android/Sdk'
arguments '-DANDROID_EMULATOR_AVD=PixelArm'
arguments '-DCMAKE_BUILD_TYPE=Debug'
arguments '-DZLIBS_DIR=' + zlib_dir_libs
arguments '-DZLIB_INC_DIR=' + zlib_dir_inc
arguments '-DANDROID_PLATFORM=android-21'
}
}
ndk {
// Specifies the ABI configurations of your native
// libraries Gradle should build and package with your APK.
// need to also have ~ boost binaries built for each abi specified here
// abiFilters 'armeabi-v7a', 'x86', 'x86_64', 'arm64-v8a'
abiFilters 'armeabi-v7a'
}
fseeko64
在 android-24 之前不可用。您必须提高 minSdkVersion
或停止使用 _FILE_OFFSET_BITS=64
.