2013-10-21 94 views
3

所以,我試圖讓一個項目,我正在寫反對的ffmpeg庫鏈接,但我一直得到了鏈接錯誤:ffmpeg的Windows庫不鏈接(visual studio)?

http://ffmpeg.zeranoe.com/builds/

1>GLViewLASReader.obj : error LNK2001: unresolved external symbol "struct AVCodec * __cdecl avcodec_find_encoder(enum AVCodecID)" ([email protected]@[email protected]@[email protected]@@Z) 
1>GLViewLASReader.obj : error LNK2001: unresolved external symbol "int __cdecl av_dict_set(struct AVDictionary * *,char const *,char const *,int)" ([email protected]@[email protected]@[email protected]) 
1>GLViewLASReader.obj : error LNK2001: unresolved external symbol "int __cdecl avcodec_encode_video(struct AVCodecContext *,unsigned char *,int,struct AVFrame const *)" ([email protected]@[email protected]@[email protected]@@Z) 
1>GLViewLASReader.obj : error LNK2001: unresolved external symbol "struct AVCodecContext * __cdecl avcodec_alloc_context3(struct AVCodec const *)" ([email protected]@[email protected]@[email protected]@@Z) 
1>GLViewLASReader.obj : error LNK2001: unresolved external symbol "struct AVFrame * __cdecl avcodec_alloc_frame(void)" ([email protected]@[email protected]@XZ) 
1>GLViewLASReader.obj : error LNK2001: unresolved external symbol "void __cdecl av_free(void *)" ([email protected]@[email protected]) 
1>GLViewLASReader.obj : error LNK2001: unresolved external symbol "int __cdecl avcodec_open2(struct AVCodecContext *,struct AVCodec const *,struct AVDictionary * *)" ([email protected]@[email protected]@[email protected]@[email protected]@@Z) 
1>GLViewLASReader.obj : error LNK2001: unresolved external symbol "int __cdecl avcodec_close(struct AVCodecContext *)" ([email protected]@[email protected]@@Z) 
1>C:\STEAMiE\usr\modules\LASReader\win32\Release\LASReader.exe : fatal error LNK1120: 8 unresolved externals 

我從下載的開發包

但是,當我像我通常會鏈接庫,我得到鏈接器錯誤。這個軟件包與我嘗試使用的其他庫不同,我只需要.h/.libs?爲什麼它必須這樣呢?

+1

由於在鏈接器錯誤信息中函數標識符處沒有_前綴,我懷疑你忘記將你在'extern「C」{}'部分使用的ffmpeg包含文件。 – alexbuisson

+0

嗯,就是這樣。我花了很多時間在這麼簡單的事情上。我會盡量記住下次。謝謝。 –

回答

4

由於鏈接器錯誤消息中的函數標識符沒有_前綴,我懷疑你忘記了在'extern「C」{}'部分中使用ffmpeg包含文件。