登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

面包会有的

... ...

 
 
 

日志

 
 

新建一个vc6工程,怎么用libx264.lib,需要哪些辅助文件  

2011-06-06 16:12:26|  分类: vc6中用x264 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

把libx264.lib拷到当前工程目录下,并把extrasextras文件夹拷过来

#pragma comment(lib, "libx264.lib")

#include "extras/stdint.h"
#include "x264.h"

如果没有#include "extras/stdint.h"
编译会提示如下

You must include stdint.h or inttypes.h before x264.h
d:\client\x264.h(161) : error C2146: syntax error : missing ';' before identifier 'cqm_4iy'
d:\client\x264.h(161) : error C2501: 'uint8_t' : missing storage-class or type specifiers
d:\client\x264.h(161) : error C2501: 'cqm_4iy' : missing storage-class or type specifiers
d:\client\x264.h(162) : error C2146: syntax error : missing ';' before identifier 'cqm_4ic'
d:\client\x264.h(162) : error C2501: 'uint8_t' : missing storage-class or type specifiers
d:\client\x264.h(162) : error C2501: 'cqm_4ic' : missing storage-class or type specifiers
d:\client\x264.h(163) : error C2146: syntax error : missing ';' before identifier 'cqm_4py'
d:\client\x264.h(163) : error C2501: 'uint8_t' : missing storage-class or type specifiers
d:\client\x264.h(163) : error C2501: 'cqm_4py' : missing storage-class or type specifiers
d:\client\x264.h(164) : error C2146: syntax error : missing ';' before identifier 'cqm_4pc'
d:\client\x264.h(164) : error C2501: 'uint8_t' : missing storage-class or type specifiers
d:\client\x264.h(164) : error C2501: 'cqm_4pc' : missing storage-class or type specifiers
d:\client\x264.h(165) : error C2146: syntax error : missing ';' before identifier 'cqm_8iy'
d:\client\x264.h(165) : error C2501: 'uint8_t' : missing storage-class or type specifiers
d:\client\x264.h(165) : error C2501: 'cqm_8iy' : missing storage-class or type specifiers
d:\client\x264.h(166) : error C2146: syntax error : missing ';' before identifier 'cqm_8py'
d:\client\x264.h(166) : error C2501: 'uint8_t' : missing storage-class or type specifiers
d:\client\x264.h(166) : error C2501: 'cqm_8py' : missing storage-class or type specifiers
d:\client\x264.h(282) : error C2143: syntax error : missing ';' before '*'
d:\client\x264.h(282) : error C2501: 'uint8_t' : missing storage-class or type specifiers
d:\client\x264.h(282) : error C2501: 'plane' : missing storage-class or type specifiers
d:\client\x264.h(293) : error C2146: syntax error : missing ';' before identifier 'i_pts'
d:\client\x264.h(293) : error C2501: 'int64_t' : missing storage-class or type specifiers
d:\client\x264.h(293) : error C2501: 'i_pts' : missing storage-class or type specifiers
d:\client\x264.h(341) : error C2143: syntax error : missing ';' before '*'
d:\client\x264.h(341) : error C2501: 'uint8_t' : missing storage-class or type specifiers
d:\client\x264.h(341) : error C2501: 'p_payload' : missing storage-class or type specifiers
D:\Client\ClientDlg.cpp(306) : warning C4244: '=' : conversion from 'long' to 'unsigned short', possible loss of data

实际上,x264源文件中,我并没有搜索到inttypes.h,只是在extras文件夹下有stdint.h

 

stdint.h中的内容都是一些typedef语句,形如下面之类:
/* 7.18.1.1  Exact-width integer types */
typedef signed char int8_t;
typedef unsigned char   uint8_t;
typedef short  int16_t;
typedef unsigned short  uint16_t;
typedef int  int32_t;
typedef unsigned   uint32_t;
typedef __int64  int64_t;
typedef unsigned __int64 uint64_t;

 在本文开始编译时有一句提示“You must include stdint.h or inttypes.h before x264.h”,这个在x264中的对应代码为:

#if !defined(_STDINT_H) && !defined(_STDINT_H_) && \
    !defined(_INTTYPES_H) && !defined(_INTTYPES_H_)
 # ifdef _MSC_VER
  #  pragma message("You must include stdint.h or inttypes.h before x264.h")
 # else
  #  warning You must include stdint.h or inttypes.h before x264.h
 # endif
#endif

在stdint.h中的对应代码为:


#ifndef _STDINT_H
#define _STDINT_H
#define __need_wint_t
#define __need_wchar_t

 

这样你就可以在程序中定义x264.h里的类型了:

 

#pragma comment(lib, "libx264.lib")

#include "extras/stdint.h"
#include "x264.h"

... ...

void CClientDlg::OnBtnStartcap()
{
 // TODO: Add your control notification handler code here

 x264_param_t dsds;//x264.h里的一种数据类型
}

  评论这张
 
阅读(2461)| 评论(0)

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018