|
|
// [+] 09/25/09 (mm/dd/yy)# A* |9 p6 n( W4 f
9 z3 {6 ^+ R4 }+ f$ |! N下载地址:
9 R2 `0 b7 |) S. F& Q Z: I! ehttp://ttpublic.googlecode.com/files/x264-snapshot-20090216-2245.rar( o l5 s6 p2 _! H8 ?+ t
" ~9 C2 ]/ _/ s. f/ Q4 u& I1 i2 { 总有人说最新的版本编译不过,搞的群、论坛里到处都是这种求助贴。建议斑竹把这个解决办法放到醒目的位置,以减少噪音。 ?4 n1 s* ?2 I u' T
2 y1 [# ]* f4 P; ?科普开始
) k/ V0 V) i. ]1 g
3 `( ~+ ^! x. p" s1、编译问题5 f& M: A [* L n
由于MS的VS编译器对C99标准支持不好,不支持函数当中混合定义、声明变量。% c3 a2 A- N! k# i
解决办法:在函数开头统一定义变量2 n Z. N& _" k' e" L5 \/ X" c f ]
4 d5 `% ]4 c9 z' }e.g6 v/ s2 N- p: D; ^* r2 E; [/ j
+ _. G5 b8 c- y% w+ N: \
编译不过& N8 \' b9 a* m+ R H; I T! s
void funA() { void funA() {
. z, o2 n1 B. ^4 F6 h7 [ int i,j; int i,j,x;' C2 W5 J" x$ U' h; q$ T
i = 0; ========> i = 0;
4 f% I2 h# G& _8 a int x = 0; x = 0;
6 j/ g+ L3 W: `; k% s8 y, R, ^4 F} }( G5 h' @8 }1 n
2 f4 e# R$ p- b
2、链接问题
5 `$ ]4 j% T+ _' A% |: T" j, u0 o% f; l7 w' @) \
libx264.lib(encoder.obj) : error LNK2019: 无法解析的外部符号 _x264_lookahead_init,该符号在函数 _x264_encoder_open_75 中被引用$ O: Q0 ^, Q" a: l7 R' c- y
1>libx264.lib(encoder.obj) : error LNK2019: 无法解析的外部符号 _x264_lookahead_is_empty,该符号在函数 _x264_encoder_encode 中被引用9 b3 l% L3 |' o5 `. j' f+ T& C' N* ]
1>libx264.lib(encoder.obj) : error LNK2019: 无法解析的外部符号 _x264_lookahead_get_frames,该符号在函数 _x264_encoder_encode 中被引用7 K2 i9 i- u9 g" g+ i9 p* `
1>libx264.lib(encoder.obj) : error LNK2019: 无法解析的外部符号 _x264_lookahead_put_frame,该符号在函数 _x264_encoder_encode 中被引用
: s7 ?9 O( E7 t& M1>libx264.lib(encoder.obj) : error LNK2019: 无法解析的外部符号 _x264_lookahead_delete,该符号在函数 _x264_encoder_close 中被引用; h/ \% w+ c& j5 p- h C
1>libx264.lib(analyse.obj) : error LNK2019: 无法解析的外部符号 _log2f,该符号在函数 _x264_mb_analyse_load_costs 中被引用
9 ? {: Z: r7 _* f
/ d/ V# E/ P' f& V, m3 H. y8 R由于最近x264_param中新添了lookahead,而对应Win32工程是没有及时更新。
& w% I* L% g4 P7 b1 `把encoder/lookahead.c添加到工程里(和encode.c放在一起)即可。5 \8 J6 i7 e0 _' E
) F# Z8 H; M) y+ B: R. h% j1 G' cerror LNK2019 unresolved external symbol _log2f
7 ?6 C& f# g4 J7 k另外,如果最后出现error LNK2019 unresolved external symbol _log2f,在osdep.h里定义一下log2f(不知道性能如何) :
/ i9 `! S' y" u: D4 ~
: n9 R, x$ C g$ t) O( z) D#ifdef _MSC_VER2 S- q- n5 _9 B; [5 D& L# c
#define inline __inline% l" L' r$ c: z7 p
#define strcasecmp stricmp' ?+ k/ \: E7 \8 J* J) r4 I
#define strncasecmp strnicmp
" h% @7 H$ |6 Z$ L# C* U7 R#define snprintf _snprintf
9 v1 f0 a& Z R! I! u#define fseek _fseeki64- T9 G" O: x- E) s2 A, G. y& o
#define ftell _ftelli64
1 w! c4 E# r& L2 o/ }9 }! M#define isfinite _finite
) U# ?5 T$ W! L; ~+ Z. H# h#define strtok_r strtok_s8 T0 d2 h6 g$ ^! T
#define _CRT_SECURE_NO_DEPRECATE
( b; h4 w) b W% C#define X264_VERSION "" // no configure script for msvc. F: C5 z9 J( N( s7 N
#define log2f(x) (logf(x)*1.4426950408889634f)6 }! L% m) y! L. B( c; n% h" H
#endif
' f" N. h4 s' m. d5 E3 o5 [$ B" U
4 B1 L; Z3 A1 z) f6 ?& K1 z或 : t# ^5 S2 F" }# X) _' Y- F: e8 |
#define log2f(x) ((float)log((double)(x)))/(log((double)2))
o: ~/ v1 k/ L: W+ J |
|