问题描述
使用android ndk r5b编译ffmpeg。
ffmpeg 0.6.1
android ndk r5b
cygwin 1.7
构建引用url:
但是,ffmpeg ./configure结果错误! (config.err文件下方)
check_cc
BEGIN /tmp/ffconf.GlDiY1P8.c
1 int main(void){return 0; }
END /tmp/ffconf.GlDiY1P8.c
/android-ndk-r5b/toolchains/arm-eabi-4.4.0/prebuilt/windows/bin/arm-eabi-gcc -fPIC -DANDROID -c -o /tmp/ffconf.1kQLpGaU.o /tmp/ffconf.GlDiY1P8.c
arm-eabi-gcc.exe:/tmp/ffconf.GlDiY1P8.c:没有这样的文件或目录
arm-eabi-gcc.exe:没有输入文件
C编译器测试失败。
所以,我只是尝试测试代码。
// test.c code
int main(){
return 0;
}
/android-ndk-r5b/toolchains/arm-eabi-4.4.0 / prebuilt / windows / bin / arm-eabi-gcc -fPIC -DANDROID -c -o ./test.o ./test.c
ok !!!!没有问题。
但是,
cp ./test.c / tmp(copy to / tmp)
arm-eabi-gcc.exe:/tmp/test.c:没有这样的文件或目录
arm- eabi-gcc.exe:没有输入文件
失败!!!
区别只是文件路径。 / tmp目录存在,权限是正确的。 /home/test.c是一样的结果。
怎么了?
我很难在Windows中使用它,但终于我设法做到了!
以前的帖子是正确的 - Cygwin路径和Windows路径有问题。
我已经尝试了上面的帖子中描述的解决方案作为第一件事,但它不工作。最后我明白了这个原因:即使你的build_android.sh文件放在Windows路径上,FFmpeg的配置仍然包含错误的路径。
所以在我的情况下,我已经从FFmpeg根目录部分更改了配置文件:
#set临时文件名
:$ {TMPDIR:= $ TEMPDIR}
:$ {TMPDIR:= $ TMP}
:$ {TMPDIR:= / tmp}
到:
#设置临时文件名
#:$ {TMPDIR:= $ TEMPDIR}
#:$ {TMPDIR:= $ TMP}
:$ {TMPDIR:= D :/ InstallTools / Android / Cygwin_Root / tmp}
此后,我收到编译。 >
compile ffmpeg with android ndk r5b.
ffmpeg 0.6.1
android ndk r5b
cygwin 1.7
build reference url : http://www.cnblogs.com/scottwong/archive/2010/12/17/1909455.html
but, ffmpeg ./configure result error! (below config.err file)
check_cc
BEGIN /tmp/ffconf.GlDiY1P8.c
1 int main(void){ return 0; }
END /tmp/ffconf.GlDiY1P8.c
/android-ndk-r5b/toolchains/arm-eabi-4.4.0/prebuilt/windows/bin/arm-eabi-gcc -fPIC -DANDROID -c -o /tmp/ffconf.1kQLpGaU.o /tmp/ffconf.GlDiY1P8.c
arm-eabi-gcc.exe: /tmp/ffconf.GlDiY1P8.c: No such file or directory
arm-eabi-gcc.exe: no input files
C compiler test failed.
so, i just try test code.
// test.c code
int main(){
return 0;
}
/android-ndk-r5b/toolchains/arm-eabi-4.4.0/prebuilt/windows/bin/arm-eabi-gcc -fPIC -DANDROID -c -o ./test.o ./test.c
ok!!!! no problem.
but,cp ./test.c /tmp (copy to /tmp)
/android-ndk-r5b/toolchains/arm-eabi-4.4.0/prebuilt/windows/bin/arm-eabi-gcc -fPIC -DANDROID -c -o ./test.o /tmp/test.c
arm-eabi-gcc.exe: /tmp/test.c: No such file or directory
arm-eabi-gcc.exe: no input files
fail!!!difference is only file path. /tmp directory exist, and permission is right. /home/test.c is same result.
what's wrong?
I have had a hard time to get it working in Windows, but finally I've managed to do it!The previous posts were correct - there's a problem with Cygwin paths and Windows paths.I have tried the solution described in the post above as the very first thing, but it was not working. Finally I've understand the reason: even if you put into your build_android.sh file the Windows path, the config for FFmpeg still contains the wrong path.
So in my case I have changed partially the config file in FFmpeg root directory from:
#set temporary file name
: ${TMPDIR:=$TEMPDIR}
: ${TMPDIR:=$TMP}
: ${TMPDIR:=/tmp}
to this:
# set temporary file name
#: ${TMPDIR:=$TEMPDIR}
#: ${TMPDIR:=$TMP}
: ${TMPDIR:=D:/InstallTools/Android/Cygwin_Root/tmp}
After this, I got it compiling.
这篇关于用android ndk r5b编译ffmpeg的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!