Vs2008编译mpeg4ip
最近项目中要添加一个MP4文件录制功能,准备用mpeg4ip实现这个功能。下面是mpeg4ip在vs2008下编译的过程,遇到的一些问题,解决办法,及一些未解决的问题。
Mpeg4ip分为两大模块:encoding60.dsw(文件的根目录下),player60.dsw(根目录\player\src)。这次编译的是1.5.0.1版本。
问题:用vs2008打开encoding60.dsw(VC开发环境生成的项目文件,用来把多个工程组织到一个项目中,文本格式)文件时,说是一些工程文件(.dsp:VC开发环境生成的工程文件,文本格式)格式不对让转换格式,但是转换后却无法加载部分工程。
解决:用UltraEdit或其它的文本工具,打开dsp文件把它转换成DOS格式,然后另存为,覆盖原文件。
问题:Cannot open include file: 'winsock6.h': No such file or directory
临时解决:将工程从Debug IPv6 Musica 调整为Debug,注释掉
int inet_pton(int af, const char *src, void *dst);
const char *inet_ntop(int af, const void *src, char *dst, size_t size);
两个函数。
问题:编译libmp4v2 工程时报:cannot convert from 'const char *' to 'char *'的错误。
解决:将 char* pSlash; 改为const char* pSlash
问题:找不到SDL.h头文件。
解决:把编译好的SDL整个项目文件夹导入mpeg4ip的根目录下,把文件名改为SDL,在SDL文件夹了见一个lib文件夹,把编译好的SDL.lib,SDL.dll,DSLmain.lib导入lib文件夹中。
问题:'int8_t' : redefinition; different basic types SDL和mpeg4ip 定义int8_t的头文件重复定义了。
解决:在SDL的sdl_config_win32.h 定义的
typedef signed __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef signed __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef signed __int32 int32_t;
typedef unsigned __int32 uint32_t;
改为
typedef signed __int8 int8_tt;
typedef unsigned __int8 uint8_tt;
typedef signed __int16 int16_tt;
typedef unsigned __int16 uint16_tt;
typedef signed __int32 int32_tt;
typedef unsigned __int32 uint32_tt;
typedef signed __int64 int64_tt;
typedef unsigned __int64 uint64_tt;
也就是重新更换一下变量名,把SDL用到的那写变量名int8_,uint8_t等全都改过来,改为如int8_tt,uint8_tt等。
经过上面的处理过后,大部分工程都可以编译过去了,不过还有几个没有编译过去。
在encoding60项目中的isoencoder工程没有编译过去,报'iostream.h': No such file or directory,'fostream.h': No such file or directory错,把头文件改为#include
在player60项目中,libmpplayer,libobj, mp4player,mpeg4_iso_plugin,wmp4client60,wmp4player60工程没有编译过去,主要报如下错误:
1,跟编译isoencoder工程一样的错误。
2,non-aggregates cannot be initialized with initializer list错误。
由于MP4文件录制只有用到libmp4v2这个工程中的libmp4v260.lib这个静态库,所以其它一些未编译过的工程没有再去做研究。