ffmpeg v2.1 프롬프트 오류

1441 단어
ommon.h(30) : fatal error C1189: #error :  missing -D__stdC_CONSTANT_MACROS/#define __stdC_CONSTANT_MACROS
원인:
FFmpeg is written in C99, thus some features may not be compilable or usable in C++.
Anyway, for most purposes, including FFmpeg headers in a C++ application should be rather straightforward.
First, to include the FFmpeg headers within your C++ application you need to explicitly state that you are including C code. You can do this by encompassing your FFmpeg includes usingextern "C", like in:
extern "C" {
#include <libavutil/imgutils.h>
#include <libavcodec/avcodec.h>
#include <libswscale/swscale.h>
}

Second, you may need to append -D__stdC_CONSTANT_MACROS to your CXXFLAGS flags, if the compiler complains about ’UINT64_C’ was not declared in this scope.
 
해결 방법:
extern "C"{ #ifdef __cplusplus #define __stdC_CONSTANT_MACROS #endif
}
 
컴파일과 프롬프트 오류:
오류 2: error C3861: "UINT64_C": 식별자 해결 방법을 찾을 수 없음:common에서.h에 다음 코드를 추가합니다.
#ifndef INT64_C#define INT64_C(c) (c## LL) #define UINT64_C(c) (c## ULL) #endif
 
ffmpeg v2.1의api와 v1.2.1api를 비교하여 몇 가지 부분을 수정했습니다.
1)v1.2.1  frame = avcodec_alloc_frame();
v.2.1 frame = av_frame_alloc();
 
2)v.1.2.1  avcodec_free_frame(&frame);
v.2.1    av_frame_free(&frame);
 

좋은 웹페이지 즐겨찾기