Mplayer > subreader.c 를 테스트 하고싶습니다.

lukep2s의 이미지

subreader.c 라는 소스 파일에 //for testing 이라고 처리되어 있는 main 함수를 실행해서 결과를 테스트하고 싶습니다.

#ifdef DUMPSUBS
int main(int argc, char **argv) {  // for testing
    sub_data *subd;
 
    if(argc<2){
        printf("\nUsage: subreader filename.sub\n\n");
        exit(1);
    }
    sub_cp = argv[2];
    subd = sub_read_file(argv[1]);
    if(!subd){
        printf("Couldn't load file.\n");
        exit(1);
    }
 
    list_sub_file(subd);
 
    return 0;
}
#endif

그래서 #define DUMPSUBS 를 subreader.c 소스파일 맨 위에 작성하고 컴파일을 했습니다

첫번째는 그냥 make 를 했고
두번째는 gcc subreader.c 만 했습니다.

그런데 어느 것도 정상적으로 되지 않습니다.

make 후 error message

    ...
    spudec.c:351: warning: 'start_pts' may be used uninitialized in this function
    cc -I./libavcodec -I./libavformat -Wdisabled-optimization -Wno-pointer-sign -Wdeclaration-after-statement -I. -I. -I./libavutil -Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 -march=pentium4 -mtune=pentium4 -pipe -ffast-math -fomit-frame-pointer -D_REENTRANT -I/usr/include/freetype2 -I/usr/include   -c -o sub_cc.o sub_cc.c
    cc -I./libavcodec -I./libavformat -Wdisabled-optimization -Wno-pointer-sign -Wdeclaration-after-statement -I. -I. -I./libavutil -Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 -march=pentium4 -mtune=pentium4 -pipe -ffast-math -fomit-frame-pointer -D_REENTRANT -I/usr/include/freetype2 -I/usr/include   -c -o subreader.o subreader.c
    subreader.c: In function 'sub_read_file':
    subreader.c:1380: error: 'sub_utf8_prev' undeclared (first use in this function)
    subreader.c:1380: error: (Each undeclared identifier is reported only once
    subreader.c:1380: error: for each function it appears in.)
    subreader.c: In function 'main':
    subreader.c:2364: error: too few arguments to function 'sub_read_file'
    make: *** [subreader.o] 오류 1

gcc subreader.c 후 error message

    In file included from subreader.c:21:
    stream/stream.h:4:20: error: mp_msg.h: No such file or directory
    subreader.c: In function ‘sub_read_file’:
    subreader.c:1380: error: ‘sub_utf8_prev’ undeclared (first use in this function)
    subreader.c:1380: error: (Each undeclared identifier is reported only once
    subreader.c:1380: error: for each function it appears in.)
    subreader.c: In function ‘main’:
    subreader.c:2364: error: too few arguments to function ‘sub_read_file’
lukep2s의 이미지