Android: error: use of undeclared identifier 'fseeko'

北战南征 提交于 2020-02-25 04:00:33

问题


When I am trying to build a boost library in Android using its source code, I am getting below error

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))

Below is my 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:


fseeko64 is not available until android-24. You have to either raise your minSdkVersion or stop using _FILE_OFFSET_BITS=64.

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



来源:https://stackoverflow.com/questions/55571842/android-error-use-of-undeclared-identifier-fseeko

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!