|
// [+] 09/25/09 (mm/dd/yy)! Z& P+ T* L/ [9 }+ ?2 k/ i& [2 c
1 _ O9 @+ ?" W! f% h+ {* E下载地址:
5 N( ^, {9 Z% s& ehttp://ttpublic.googlecode.com/files/x264-snapshot-20090216-2245.rar8 i( K) U5 d' b9 U
/ r. J9 e5 F9 b4 A
总有人说最新的版本编译不过,搞的群、论坛里到处都是这种求助贴。建议斑竹把这个解决办法放到醒目的位置,以减少噪音。
& R- D$ v" A4 d x( G w. K% p0 D. U# w* e3 j" L
科普开始
- m! m$ y) s2 f1 h: Q4 N' g- A0 \* _, L9 H8 Y/ b6 U
1、编译问题! | A m3 o7 t, t
由于MS的VS编译器对C99标准支持不好,不支持函数当中混合定义、声明变量。; n2 M* @& |& r) E3 g$ h- ^, d; G( B2 [
解决办法:在函数开头统一定义变量6 h, t# A2 q4 }5 y
6 v# e* B6 [3 o7 ?e.g
: j8 u3 h- x& [ }" t2 ?. ?! y6 L7 F; r. M
编译不过8 n. B9 S' K; }9 r' I/ D: g
void funA() { void funA() {
" p$ y0 E- x) J int i,j; int i,j,x;7 a) G( O! L# g x3 _' s
i = 0; ========> i = 0;- Q) s( c' I; q u
int x = 0; x = 0;
9 i" D& F' f, s! }} }
; E; J$ L3 p( a7 L
# f+ K7 e7 m9 p6 g' l2、链接问题7 d. q3 o; c2 j, W' r
3 u; K0 i2 W: P5 i4 S+ I: Y. x1 a
libx264.lib(encoder.obj) : error LNK2019: 无法解析的外部符号 _x264_lookahead_init,该符号在函数 _x264_encoder_open_75 中被引用& G4 d2 F% j( h% X
1>libx264.lib(encoder.obj) : error LNK2019: 无法解析的外部符号 _x264_lookahead_is_empty,该符号在函数 _x264_encoder_encode 中被引用! C, G7 b' m4 K' y0 z. e( G& z
1>libx264.lib(encoder.obj) : error LNK2019: 无法解析的外部符号 _x264_lookahead_get_frames,该符号在函数 _x264_encoder_encode 中被引用+ u/ Z5 R6 K" l- M$ V' H/ H9 p
1>libx264.lib(encoder.obj) : error LNK2019: 无法解析的外部符号 _x264_lookahead_put_frame,该符号在函数 _x264_encoder_encode 中被引用7 S s9 F0 R3 U' ~# w
1>libx264.lib(encoder.obj) : error LNK2019: 无法解析的外部符号 _x264_lookahead_delete,该符号在函数 _x264_encoder_close 中被引用
" Q8 ?0 h4 V0 E4 d# s1>libx264.lib(analyse.obj) : error LNK2019: 无法解析的外部符号 _log2f,该符号在函数 _x264_mb_analyse_load_costs 中被引用# Y1 p+ X: N! t/ x5 U- J; F/ X
! a2 P* n: d8 q* G2 Y1 I; d+ F由于最近x264_param中新添了lookahead,而对应Win32工程是没有及时更新。( W' E4 c0 E$ v! X( t
把encoder/lookahead.c添加到工程里(和encode.c放在一起)即可。 e9 L" f; G3 Y: x# G
2 H& ~: A# I) zerror LNK2019 unresolved external symbol _log2f
9 w; e6 F* ~2 B7 U另外,如果最后出现error LNK2019 unresolved external symbol _log2f,在osdep.h里定义一下log2f(不知道性能如何) :6 ~1 ^+ ^+ C7 q5 n1 m- c, F7 N
6 |" }. @5 R8 F* r4 a: d+ y
#ifdef _MSC_VER$ P: E& o' J9 t9 T' T2 G
#define inline __inline* b l3 p7 Q7 v5 R4 E# Y9 ?# ]
#define strcasecmp stricmp9 i8 ]. W2 E) j! f4 p# Y' @' ^
#define strncasecmp strnicmp8 J" [1 ^* Z2 f& H4 F$ n
#define snprintf _snprintf) ^- j6 X" m" I+ }
#define fseek _fseeki64% a, x6 s6 ` h# a& H2 ?
#define ftell _ftelli64
* e9 Q0 l7 Z) D' @0 ~: m2 A# U) S#define isfinite _finite
% D+ G0 S. s0 S6 e i! y7 _#define strtok_r strtok_s
' n d5 D. ^3 E, _#define _CRT_SECURE_NO_DEPRECATE
' K: ]. }! W$ W3 S; o! p#define X264_VERSION "" // no configure script for msvc
' q, z- ?% S$ i9 _ V2 D0 ?#define log2f(x) (logf(x)*1.4426950408889634f)$ X5 F5 a9 H+ ^, J! s& l' `, L
#endif
/ C/ V, g, }. w& d! r8 k- w3 |- Y1 N& ^& r& b. E
或 :
# |+ N2 z$ F& {; c7 g! _ A#define log2f(x) ((float)log((double)(x)))/(log((double)2))
# D- r. \8 [. O, i) u- P9 m |
|