函数 'lseek64' 的隐式声明在 C99 中无效

implicit declaration of function 'lseek64' is invalid in C99

我在编译 FFmpeg-Vitamio.

时遇到以下编译错误

我的 OS 是 Mac OS X 10.10.9

NDK版本:android-ndk-r10d

Gcc 版本:

$gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.1.1
Thread model: posix

错误信息:

libavformat/fd.c:59:9: error: implicit declaration of function 'lseek64' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    return lseek64(fd, pos, whence);

对于 linux 系统,使用:

#define _LARGEFILE64_SOURCE     /* See feature_test_macros(7) */
#include <sys/types.h>
#include <unistd.h>

为 lseek64 提供合适的原型

我不确定这与 mac OS 和使用 arm-linux-antroideabi-gcc 工具有什么关系

@anton 是对的。

使用了错误的gcc,

${NDK_HOME}/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc

应该使用