![](/img/trans.png)
[英]Why the Implicit declaration of function 'usleep' is invalid in C99` happened when compile C library in Xcode 6?
[英]implicit declaration of function 'lseek64' is invalid in C99
编译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);
对于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
应该用
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.