|
|
// [+] 09/25/09 (mm/dd/yy)$ G6 Z0 K9 }* c `+ K9 s
7 _* J1 z' r: E% C& o
下载地址:1 G: {& o7 `% Z3 M( g4 S; }
http://ttpublic.googlecode.com/files/x264-snapshot-20090216-2245.rar
9 K8 }. P* N% I; |! P0 y' v8 _1 I
总有人说最新的版本编译不过,搞的群、论坛里到处都是这种求助贴。建议斑竹把这个解决办法放到醒目的位置,以减少噪音。
/ `/ I9 _+ H8 C$ b$ d, ?
( `$ ~6 J+ X F5 W科普开始
1 Z7 ]; z/ d( F/ i7 p% l" ~! ` {: U/ E8 n9 f5 [! V
1、编译问题& v- c M# P7 V$ b1 q0 Y/ I
由于MS的VS编译器对C99标准支持不好,不支持函数当中混合定义、声明变量。
; l0 w; x$ v- B& T6 u解决办法:在函数开头统一定义变量' L. x! g. ?, j
, q- X4 y+ h2 o$ _( M$ k0 B
e.g m: l+ F! p( r9 @3 B; V
8 Y* Y% E3 {9 h/ B7 L& s0 f( n: g# T编译不过
h y5 g0 l8 ]% Bvoid funA() { void funA() {
: Y$ j2 o/ R3 W) Z( {$ Z7 H2 Y* } int i,j; int i,j,x;
9 A1 C# l8 ]) w( N1 } i = 0; ========> i = 0;
5 R& b( q- o$ v2 o- c int x = 0; x = 0; u" V' h% ^. \/ d9 K
} }
4 s# f& m! u1 d+ k* K' L0 b; ^4 T8 {) q/ B( G( F2 }$ \9 I
2、链接问题' O. H8 D7 i# v" O+ U
n& I; h; P# e. a1 Y3 |
libx264.lib(encoder.obj) : error LNK2019: 无法解析的外部符号 _x264_lookahead_init,该符号在函数 _x264_encoder_open_75 中被引用( e7 m# I `, A2 T) t5 l1 n. ~6 Q
1>libx264.lib(encoder.obj) : error LNK2019: 无法解析的外部符号 _x264_lookahead_is_empty,该符号在函数 _x264_encoder_encode 中被引用6 D. W9 O5 s, `
1>libx264.lib(encoder.obj) : error LNK2019: 无法解析的外部符号 _x264_lookahead_get_frames,该符号在函数 _x264_encoder_encode 中被引用
# I. q O N H+ t3 e7 t+ o9 z1>libx264.lib(encoder.obj) : error LNK2019: 无法解析的外部符号 _x264_lookahead_put_frame,该符号在函数 _x264_encoder_encode 中被引用
. L1 I; N3 N8 m9 D, q1>libx264.lib(encoder.obj) : error LNK2019: 无法解析的外部符号 _x264_lookahead_delete,该符号在函数 _x264_encoder_close 中被引用; P }! b) Z) |! Q8 p9 t
1>libx264.lib(analyse.obj) : error LNK2019: 无法解析的外部符号 _log2f,该符号在函数 _x264_mb_analyse_load_costs 中被引用0 L( k! U6 @! B7 y2 D& Y4 a& f
- |1 V& q" t5 R$ k7 o
由于最近x264_param中新添了lookahead,而对应Win32工程是没有及时更新。
1 R; ?- l; _- L( i把encoder/lookahead.c添加到工程里(和encode.c放在一起)即可。
+ l* a+ |1 Z* _! B& r% F; h* t( b; u0 F* q2 V' G6 N5 F
error LNK2019 unresolved external symbol _log2f
z5 S7 [& L' ^0 \9 f2 G# l另外,如果最后出现error LNK2019 unresolved external symbol _log2f,在osdep.h里定义一下log2f(不知道性能如何) :( T- Q3 |7 h- @1 \' s& m2 q- T
3 M. W9 X" l1 ~$ B, [4 b#ifdef _MSC_VER
; f: _ h) R# @: E$ a# u9 A0 s#define inline __inline. D( | D7 |( c$ Y7 Z$ X4 \" }
#define strcasecmp stricmp. d* X+ l2 W# h/ P9 y- S
#define strncasecmp strnicmp
6 H- D+ p2 g. o+ m+ ]$ V" Q# J#define snprintf _snprintf# D) W b% k' _% O
#define fseek _fseeki64
@6 F* {# A. y1 x+ F( D) b0 H2 X#define ftell _ftelli64
p8 L; | J7 v: D#define isfinite _finite
9 y X( D6 t* Z+ _0 g#define strtok_r strtok_s9 p+ q9 b6 s! d" i; b' K
#define _CRT_SECURE_NO_DEPRECATE5 z; z7 f4 b9 H9 z+ {
#define X264_VERSION "" // no configure script for msvc
3 [' L8 _! ]9 q; e% Z# L#define log2f(x) (logf(x)*1.4426950408889634f)/ i; f( [; p5 n
#endif0 w5 ], Q% } O' u- W: P" R/ T
0 z/ a" G3 ?1 {. |& T6 j或 :
2 g3 \# Z2 y- k2 z, o, N#define log2f(x) ((float)log((double)(x)))/(log((double)2)): b7 y' R0 b! [" N' C3 y
|
|