Android:错误:使用未声明的标识符'fseeko'

时间:2019-04-08 10:56:23

标签: android c++ boost android-ndk

当我尝试使用其源代码在Android中构建Boost库时,出现错误提示

  

版本| armeabi-v7a:D:/ Android / SDK / NDK->捆绑/工具链/ llvm / prebuilt / windows-x86_64 / sysroot / usr / include / c ++ / v1 \ fstream:969:9:   release | armeabi-v7a:错误:使用未声明的标识符“ fseeko”   release | armeabi-v7a:如果(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'
        }

1 个答案:

答案 0 :(得分:0)

fseeko64在android-24之前不可用。您必须举起minSdkVersion或停止使用_FILE_OFFSET_BITS=64

https://android.googlesource.com/platform/ndk/+/master/docs/user/common_problems.md#using-with-early-api-levels