隐含的功能声明' lseek64'在C99中无效

时间:2015-05-19 09:28:56

标签: android c++ c android-ndk ffmpeg

编译FFmpeg-Vitamio时,我遇到了以下编译错误。

我的操作系统 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);

2 个答案:

答案 0 :(得分:1)

对于linux系统,请使用:

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

为lseek64准备一个合适的原型

我不确定这将如何与mac OS和arm-linux-antroideabi-gcc工具相关

答案 1 :(得分:0)

@anton是对的。

使用了错误的gcc,

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

应该使用