|
|
// [+] 09/25/09 (mm/dd/yy)# i/ n1 @/ W) k. C H$ @
3 ]7 o% X) X5 g2 v; y% |下载地址:
- `5 C& b8 e3 J# Z3 J) y( c1 `: b1 d$ T1 ^http://ttpublic.googlecode.com/files/x264-snapshot-20090216-2245.rar& {- M. Q6 J) o! Y/ n, F+ l; _
0 y p' M7 W0 k8 R 总有人说最新的版本编译不过,搞的群、论坛里到处都是这种求助贴。建议斑竹把这个解决办法放到醒目的位置,以减少噪音。
- Q( V: e5 r6 {8 ?
/ U4 f# d) c. f科普开始9 F! b8 j. {' [6 `, c; ~ D, Y
' P; p1 C- F7 E9 K0 ~
1、编译问题, F$ U' ^6 K2 P) m: Y
由于MS的VS编译器对C99标准支持不好,不支持函数当中混合定义、声明变量。5 i( r5 x' L1 X* q
解决办法:在函数开头统一定义变量
6 | i1 t9 H+ T9 D: P7 A2 _
* A& [# m" a$ T! Ge.g1 w# y( P. d1 h- s
" `1 B! \. U1 g" F
编译不过
1 M: a8 z: Q8 q3 Y' kvoid funA() { void funA() {
! F# U* h$ k0 U: n int i,j; int i,j,x;
* R" ^' }" f3 ^% R i = 0; ========> i = 0;
' I& w7 V+ J/ c+ V/ | int x = 0; x = 0;
9 V) g3 B/ y5 U2 Y9 c: d3 q} }
% V7 F3 C; @8 ?$ m9 l( I7 `0 n+ P+ p
2、链接问题- x9 x6 s& t% ~' a- _+ z
* j9 {$ l- I4 @5 V
libx264.lib(encoder.obj) : error LNK2019: 无法解析的外部符号 _x264_lookahead_init,该符号在函数 _x264_encoder_open_75 中被引用, G5 Z: z3 D, Z9 O5 P
1>libx264.lib(encoder.obj) : error LNK2019: 无法解析的外部符号 _x264_lookahead_is_empty,该符号在函数 _x264_encoder_encode 中被引用
( L% T6 t- w2 K- k1>libx264.lib(encoder.obj) : error LNK2019: 无法解析的外部符号 _x264_lookahead_get_frames,该符号在函数 _x264_encoder_encode 中被引用7 }5 A8 @! ^0 v4 A& f: N! {
1>libx264.lib(encoder.obj) : error LNK2019: 无法解析的外部符号 _x264_lookahead_put_frame,该符号在函数 _x264_encoder_encode 中被引用
. s8 r3 j' K* g; ^) K1>libx264.lib(encoder.obj) : error LNK2019: 无法解析的外部符号 _x264_lookahead_delete,该符号在函数 _x264_encoder_close 中被引用) G; ]4 M, \7 D/ \. T
1>libx264.lib(analyse.obj) : error LNK2019: 无法解析的外部符号 _log2f,该符号在函数 _x264_mb_analyse_load_costs 中被引用5 v5 b& G' `8 \5 {
, l9 \4 u$ @ J
由于最近x264_param中新添了lookahead,而对应Win32工程是没有及时更新。
* P/ W) Y; i1 v8 i把encoder/lookahead.c添加到工程里(和encode.c放在一起)即可。
/ V) e* M7 O. H. W' P/ G$ x( G: R+ g) X5 Q$ o- K8 r
error LNK2019 unresolved external symbol _log2f# F( |' F& m8 ^" a! H
另外,如果最后出现error LNK2019 unresolved external symbol _log2f,在osdep.h里定义一下log2f(不知道性能如何) :; E) I r1 T& g% r9 s
% R: B8 s5 P$ J
#ifdef _MSC_VER
: v* j0 J! J* j. g# B" _9 @#define inline __inline" ?( o3 P8 \/ C& H) j `* y
#define strcasecmp stricmp$ g( X8 ~/ u5 f1 z t, i% v& x
#define strncasecmp strnicmp
! a# `0 n+ G n H7 C#define snprintf _snprintf! N3 r5 ]: u) O+ W4 g( ]+ K7 B
#define fseek _fseeki64
+ Z7 g9 l% `5 j/ _+ {#define ftell _ftelli64
, r# {; b0 e9 g#define isfinite _finite# _/ m! g s+ U- ^% a! `
#define strtok_r strtok_s
$ S) o* `! g0 h#define _CRT_SECURE_NO_DEPRECATE
& Z r) k0 g. i, v! I; K! T7 D#define X264_VERSION "" // no configure script for msvc
( N6 m6 ~3 m# @' |- @; z' n; q#define log2f(x) (logf(x)*1.4426950408889634f)
: E, i- W8 }- d7 | G#endif
# J2 c* ]: n* ?4 h0 @3 z2 H9 n! a; L$ D8 @& _
或 :! P0 ~- t4 @( g9 s Z; i1 d
#define log2f(x) ((float)log((double)(x)))/(log((double)2))
( w. V6 j, b; G |
|