|
// [+] 09/25/09 (mm/dd/yy). ?2 g1 D1 P1 ]2 q/ T, |5 @+ t
3 e; v2 W! Z8 N
下载地址:) f3 m. z6 v4 e( O: X& A
http://ttpublic.googlecode.com/files/x264-snapshot-20090216-2245.rar# Y0 X- ]' R' `4 ^4 `5 F/ h
- C' B) ^- i4 y 总有人说最新的版本编译不过,搞的群、论坛里到处都是这种求助贴。建议斑竹把这个解决办法放到醒目的位置,以减少噪音。" r: ^+ w3 W, l4 y( b
& i- ?8 V+ b, d/ a2 F& Z" p
科普开始
, b q! G" u% F8 L
( ]# w* @4 u8 t! h& \1、编译问题
2 a4 S, h+ k0 i3 r4 p* U由于MS的VS编译器对C99标准支持不好,不支持函数当中混合定义、声明变量。
$ ~- z0 M+ t' I& X$ J8 l# {解决办法:在函数开头统一定义变量
' d! ?9 c. S( w: h, y+ w7 U
1 H5 ]. T$ f2 t+ }$ _e.g: B7 B6 F1 I& u5 @8 T! ~
0 Q# Q6 W+ J' U/ E _编译不过
9 e( i$ n+ c% w4 `! X8 avoid funA() { void funA() {
/ n* r+ \: o" Y6 e( R( C4 R' e int i,j; int i,j,x;
8 ^5 K3 i( |) p% P8 {/ J1 B i = 0; ========> i = 0;
8 F. V# z6 j' A" t) r' a2 S' i% q int x = 0; x = 0;
) L7 a7 ?. h- Y* ?1 l' n1 g} }$ J I/ H! M& ~ w' R
0 m; }, M$ s& [% |* G/ a2 }' `2、链接问题
* W* P l$ R# X- l1 p) v
; C2 p" W: {# a8 _0 G4 clibx264.lib(encoder.obj) : error LNK2019: 无法解析的外部符号 _x264_lookahead_init,该符号在函数 _x264_encoder_open_75 中被引用
9 e' e3 I& C' Q" T" [( _1>libx264.lib(encoder.obj) : error LNK2019: 无法解析的外部符号 _x264_lookahead_is_empty,该符号在函数 _x264_encoder_encode 中被引用' F. c6 g% ?, P3 f8 S8 x
1>libx264.lib(encoder.obj) : error LNK2019: 无法解析的外部符号 _x264_lookahead_get_frames,该符号在函数 _x264_encoder_encode 中被引用
+ P" B. ~9 T% f4 G; c1>libx264.lib(encoder.obj) : error LNK2019: 无法解析的外部符号 _x264_lookahead_put_frame,该符号在函数 _x264_encoder_encode 中被引用9 t' b+ y2 C* _1 {+ v
1>libx264.lib(encoder.obj) : error LNK2019: 无法解析的外部符号 _x264_lookahead_delete,该符号在函数 _x264_encoder_close 中被引用! o/ O5 D$ F1 a$ @5 V0 T; s
1>libx264.lib(analyse.obj) : error LNK2019: 无法解析的外部符号 _log2f,该符号在函数 _x264_mb_analyse_load_costs 中被引用
; ?9 Z. z) p2 d8 Z7 P, W8 H1 N- R) T; R* a* k' N
由于最近x264_param中新添了lookahead,而对应Win32工程是没有及时更新。
4 Y' ]- Z+ n1 x0 S! h1 |把encoder/lookahead.c添加到工程里(和encode.c放在一起)即可。
- A; m) h& F! p8 ~( J
. `6 i8 [5 R% kerror LNK2019 unresolved external symbol _log2f+ D, ^( c' ?& d0 @$ a' |
另外,如果最后出现error LNK2019 unresolved external symbol _log2f,在osdep.h里定义一下log2f(不知道性能如何) :
& {$ Y* \1 h$ m: c' P. z4 ~! P8 Z) F, F" U
#ifdef _MSC_VER
9 n& A# t% O/ v#define inline __inline
" }" j4 _0 O/ e2 I* z& X% e#define strcasecmp stricmp# X# P3 H6 L# ~9 c% d" \
#define strncasecmp strnicmp
6 G. |4 O' ]1 c& n& S0 s#define snprintf _snprintf# L# ?1 P% D: a$ p! p- | |3 @
#define fseek _fseeki64' }, j: z. N8 g6 e) o( t# w: V
#define ftell _ftelli64. Z, _" _* J+ r6 t% Y4 @
#define isfinite _finite
6 c% S+ `- d4 i/ d#define strtok_r strtok_s
' Z0 l+ `0 V' h. k#define _CRT_SECURE_NO_DEPRECATE% |- g2 k4 R+ j+ m
#define X264_VERSION "" // no configure script for msvc X6 }3 {9 p2 ^& I8 L8 v
#define log2f(x) (logf(x)*1.4426950408889634f)1 D- r( M* J+ y/ |' P. Q- Y) f5 Q
#endif! ^& M; s3 ]6 R! G4 Y3 O
2 H( _2 Y: u% x9 o! @# ?# m或 :7 O" Z5 V# Z) Y' v, y: p
#define log2f(x) ((float)log((double)(x)))/(log((double)2))' p# Z ?2 X5 l3 C; X K% Q
|
|