2017-04-27 21 views
1

次のコードを作成しようとしています。しかし、それはエラー "エラーLNK1120:未解決の5つの外観"として表示されます。私はVisual Studio 2013でC++を使用しています。ライブラリは適切に含まれています。 avformat_open_inputメソッドでエラーが発生します。私は私のコードでffmpegでmuxingを使用しています。助けてください。エラーLNK1120:未解決の外部

const char *url = "H:/Sanduni_projects/ad_2.mp4"; 

AVFormatContext *s = NULL; 
int ret = avformat_open_input(&s, url, NULL, NULL); 
if (ret < 0) 
    abort(); 

AVDictionary *options = NULL; 

av_dict_set(&options, "video_size", "640x480", 0); 
av_dict_set(&options, "pixel_format", "rgb24", 0); 

if (avformat_open_input(&s, url, NULL, &options) < 0){ 
    abort(); 
} 

av_dict_free(&options); 

AVDictionaryEntry *e; 

if (e = av_dict_get(options, "", NULL, AV_DICT_IGNORE_SUFFIX)) { 
    fprintf(stderr, "Option %s not recognized by the demuxer.\n", e->key); 
    abort(); 
} 

avformat_close_input(&s); 
+1

*プロジェクトプロパティ - >リンカー - >入力*でプロジェクトにライブラリを追加する必要があります。 –

+0

すでにライブラリを正しく追加しました。 –

答えて

2

問題が修正されました。これをコードに追加しました

extern "C" { 
    #endif 
    #include <libavcodec/avcodec.h> 
    #include <libavformat/avformat.h> 
    #include <libswscale/swscale.h> 
    #ifdef __cplusplus 
} 
#endif 
関連する問題