安装mingw+msys问题之三——其他环境问题
来源:互联网 发布:云天明 知乎 编辑:程序博客网 时间:2024/06/03 17:45
configure的库检查依赖于pkg-config,而其又依赖于glib,则两者必须安装。如果需要编译ffplay,有需要依赖SDL-devel。
这样就够了吗?不是。编译的过程中,出现了一个莫名其妙的问题,/home/keith/staged/mingw32/lib/libiconv.la: No such file or directory
一个外国哥们和我遇到同样的问题,当时下面有人解释了的,我觉得挺有道理的。
http://stackoverflow.com/questions/23637991/why-does-building-liblzma-fail-with-cannot-find-the-library
以下为英文摘录:
According to this bug report, there is something wrong with the latest gettext package (gettext-0.18.3.2).
I've tried the following 2 ways. It seems both working well.
Remove bad files
pushd /mingw/lib/ && rm libasprintf.la libgettextlib.la libgettextpo.la libgettextsrc.la libintl.la && popd
Or you can just rename them. In fact, you will see /home/keith/... in these *.la files if you open them with text editors.
Use gettext-0.18.3.1 package
Close MSYS and run the following command to use the older version: mingw-get upgrade "gettext=0.18.3.1-1*" , with PATH=C:\mingw\bin;%PATH%, of course.
再一次configure make,又出现了问题。c:\mingw\include\unistd.h:79:1: error: expected ',' or ';' before 'int' int
看了一个博客,他说 http://blog.csdn.net/u013699869/article/details/45894083
libavutil\file.c
libavutil\file_open.c
libavutil\log.c
libavutil\random_seed.c
libavutil\time.c
libavformat\cache.c
libavformat\dashenc.c
libavformat\file.c
libavformat\hdsenc.c
libavformat\smoothstreamingenc.c
libavformat\hlsenc.c
libavcodec\libxvid.c
libavcodec\libxvid_rc.c
ffmpeg.c
都有这个错误。其实是没有找到 _EXTERN_C _cdecl __MINGW_NOTHROW ,其在 window.h 中。
解决办法:在以上文件中, #include <unistd.h> 之前加上 #include <windows.h>
他的方法我没试过,但直觉觉得应该有用,只是太麻烦了,而且我觉得改了ffmpeg的源码之后,问题会越来越多,于是尝试了下面一个博客的办法。
http://blog.csdn.net/dancing_night/article/details/44831085#0-renren-1-41719-98fde57bb3d39343db0f272b38411f3e
将unistd.h文件修改,
解决方案:
把unistd.h里的内容替换为:
#ifndef _UNISTD_H
/*
* This file is part of the Mingw32 package.
*
* unistd.h maps (roughly) to io.h
* Other headers included by unistd.h may be selectively processed;
* __UNISTD_H_SOURCED__ enables such selective processing.
*/
#define _UNISTD_H
#define __UNISTD_H_SOURCED__ 1
#include <io.h>
#include <process.h>
#include <getopt.h>
/* These are also defined in stdio.h. */
#ifndef SEEK_SET
#define SEEK_SET 0
#endif
#ifndef SEEK_CUR
#define SEEK_CUR 1
#endif
#ifndef SEEK_END
#define SEEK_END 2
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if !defined __NO_ISOCEXT
#include <sys/types.h> /* For useconds_t. */
int __cdecl __MINGW_NOTHROW usleep(useconds_t useconds);
#endif /* Not __NO_ISOCEXT */
/* This is defined as a real library function to allow autoconf
to verify its existence. */
int ftruncate(int, off_t);
#ifndef __NO_INLINE__
__CRT_INLINE int ftruncate(int __fd, off_t __length)
{
return _chsize (__fd, __length);
}
#endif
#ifdef __cplusplus
}
#endif
#undef __UNISTD_H_SOURCED__
#endif /* _UNISTD_H */
再次编译,通过了。make完成。make install。但是用ffmpeg.exe进行转码的时候,会缺少依赖库,得装faac,fdk-aac,x264(编码h264)
忘了说一个yasm的问题,ffmpeg为了加快编译的速度,使用了汇编代码,因此编译时会出现找不到yasm asm之类的问题,两种方式解决,一种通过编译选项--disable-asm,不使用汇编代码,另一种下载yasm.exe,放在bin目录之下,命名必须是yasm.exe
- 安装mingw+msys问题之三——其他环境问题
- 安装mingw+msys问题之一——mintty
- 安装mingw+msys问题之二——GCC is unable to create an exe
- Installing MSYS-MinGW (安装MSYS和MinGW开发环境)
- 使用MinGW和MSYS时的问题
- MinGW+MSYS安装
- MinGW 和 MSYS 的手动安装与环境配置
- 搭建MinGW+Msys+Git环境
- 解决msys和MinGW中文乱码以及输入中文问题
- [MinGW]_[C/C++]_[msys的使用问题]
- 使用MinGW 与 MSYS 编译 ffmpeg 的问题说明
- Windows上安装MinGW+MSYS
- Windows上安装MinGW+MSYS
- MinGW和MSYS的安装
- 关于 MinGW 安装问题
- 在msys/MinGW环境下编译gstreamer
- MinGw+Msys搭建环境 编译ffmpeg
- MinGw+Msys搭建环境 编译ffmpeg
- flume+kafka+storm+mysql架构设计
- ios开发之实现长按UITableViewCell弹出UIMenuController
- 自动化构建
- python生成器的几个问题
- Ftp操作
- 安装mingw+msys问题之三——其他环境问题
- Android Fragment 真正的完全解析(上)
- 杭电ACM2037java做法
- arm指令中mov和ldr的区别
- C/C++校招笔试面试经典题目总结九
- iOS开发-Day12-C的复习
- ios 常用的正则表达式
- android开发 Edittext编辑框超出屏幕
- Mycat ERROR 1064 (HY000): bad insert sql