|
|
// [+] 09/25/09 (mm/dd/yy)
$ Q+ i: v8 P2 u! ]* i2 u) O& Q" x
; ~5 w1 b5 L6 e+ v下载地址:
5 ?% {& e# p# ?, T# S& ?3 E2 Yhttp://ttpublic.googlecode.com/files/x264-snapshot-20090216-2245.rar
* L$ j! G+ d+ j4 ]
! W0 i7 k3 S( I. @% p7 L 总有人说最新的版本编译不过,搞的群、论坛里到处都是这种求助贴。建议斑竹把这个解决办法放到醒目的位置,以减少噪音。# ^2 F6 G+ ?1 I4 E" w7 N* ?
6 f& f# R$ d7 P) b科普开始
' g' K, C5 H) K2 F; j) B$ e
& G7 N+ g( A* a) i8 N. W7 U1、编译问题( c% o' P7 ?+ }- d
由于MS的VS编译器对C99标准支持不好,不支持函数当中混合定义、声明变量。6 x6 \5 K5 [ _5 }' i4 y
解决办法:在函数开头统一定义变量
. {# r1 U4 O9 h0 {) r1 N' U$ k( F/ v% X! L9 K. z* Q
e.g2 r) t8 C( U$ [- v
: n4 o: d/ f6 G# c, P( f( Z% Q+ K/ O
编译不过2 s. ]; G7 t& L# s& s! g
void funA() { void funA() {% ?+ n/ @7 `! y: B5 n7 z, u
int i,j; int i,j,x;
, N, }8 J% A3 D. C/ M! t, ^" v! l i = 0; ========> i = 0;
! r. v; l* C/ _. E; w# A int x = 0; x = 0;% ^2 b/ f* e6 [+ y m- g/ K; z2 S& V
} }
5 h9 J2 l4 w# }, {, \0 z
$ e, _/ \, }. j) J- k2、链接问题
. p* A" Q- F- m7 W
, B* i/ S: h# \* B0 w( Glibx264.lib(encoder.obj) : error LNK2019: 无法解析的外部符号 _x264_lookahead_init,该符号在函数 _x264_encoder_open_75 中被引用7 s' v$ s% }2 C" U e* Y
1>libx264.lib(encoder.obj) : error LNK2019: 无法解析的外部符号 _x264_lookahead_is_empty,该符号在函数 _x264_encoder_encode 中被引用- W! Z0 P) K- _. u( V6 @
1>libx264.lib(encoder.obj) : error LNK2019: 无法解析的外部符号 _x264_lookahead_get_frames,该符号在函数 _x264_encoder_encode 中被引用+ D8 [, ]% r7 c' x
1>libx264.lib(encoder.obj) : error LNK2019: 无法解析的外部符号 _x264_lookahead_put_frame,该符号在函数 _x264_encoder_encode 中被引用
# y# A* t _% ?2 e3 d& j1>libx264.lib(encoder.obj) : error LNK2019: 无法解析的外部符号 _x264_lookahead_delete,该符号在函数 _x264_encoder_close 中被引用
# Y: {2 W6 l4 [8 O0 u1>libx264.lib(analyse.obj) : error LNK2019: 无法解析的外部符号 _log2f,该符号在函数 _x264_mb_analyse_load_costs 中被引用
& {; g0 U- |5 X% I; I& i
# {% ^6 V% i+ J8 @ R( Y由于最近x264_param中新添了lookahead,而对应Win32工程是没有及时更新。. z5 N) j+ d- _* K5 Y/ ?
把encoder/lookahead.c添加到工程里(和encode.c放在一起)即可。
3 ?1 @! A2 M4 H7 W2 ] O) R0 j. r( `- G O5 L9 h
error LNK2019 unresolved external symbol _log2f- {" a$ u- z$ H' |: O
另外,如果最后出现error LNK2019 unresolved external symbol _log2f,在osdep.h里定义一下log2f(不知道性能如何) :
1 ~$ I% V, M2 G1 G n2 }" {9 c& r5 t; Y* |% X' P
#ifdef _MSC_VER- a0 J D2 s+ d! X7 }
#define inline __inline8 n H5 d$ O9 U2 }
#define strcasecmp stricmp- I3 t0 R2 a( O6 g- r
#define strncasecmp strnicmp/ z! g" E6 n1 n7 s' [: y
#define snprintf _snprintf
0 Z8 b$ |" k( J: ?#define fseek _fseeki644 Q/ M; P, V) v* k" s- e/ S+ f
#define ftell _ftelli64
$ P; r" k1 e4 Q/ z0 x% E( d) O8 K#define isfinite _finite& l* O5 n$ F% i3 w
#define strtok_r strtok_s( `% m% g2 t+ n% T
#define _CRT_SECURE_NO_DEPRECATE; y1 f" S( Q! A$ F/ x
#define X264_VERSION "" // no configure script for msvc
2 X" e' ~1 I9 D7 l: R#define log2f(x) (logf(x)*1.4426950408889634f)8 j) d0 Y5 I3 i/ {; V) ~
#endif
@! o* w, b0 a7 V- x3 }
6 S) X2 o3 k) @' g$ [或 :$ L9 `& }9 W# ?: Z } x
#define log2f(x) ((float)log((double)(x)))/(log((double)2))* L4 ~ |7 r+ F9 W, N) Z! H' z# v+ Z
|
|