gpt4 book ai didi

c++ - 在Visual Studio 2013终极项目中使用FFMPEG,链接错误LNK2019

转载 作者:行者123 更新时间:2023-11-30 05:45:37 29 4
gpt4 key购买 nike

我正在尝试在我的项目中使用 FFmpeg 库和 TIFF 库(我也在制作 .dll 和/或 .exe)。我搜索了此处和 Google 提供的答案,并将/dev/include 64 位(32 位 VS 制作 64 位项目)链接到其他包含目录,并将 shared/bin(库文件)64 位链接到链接器->Additional Library Directories 并添加了 Linker->Additional Depedencies->avformat.lib。我也将 .dll 文件复制到我的项目文件夹,但我仍然继续获取 LNK2019。以下是我如何使用库和编译器的输出:

extern "C" {

#ifndef inline
#define inline __inline
#endif
#ifndef UINT64_C
#define UINT64_C uint64_t
#define INT64_C int64_t
#endif

#include <libavcodec\avcodec.h>
#include <libavformat\avformat.h>
#include <libswscale\swscale.h>

}
#pragma comment(lib, "avformat.lib")

1>------ Build started: Project: GHSOM_V3, Configuration: FFmpeg x64 ------
1> ffmpeg_io.cpp
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol av_malloc referenced in function "struct AVFrame * __cdecl alloc_picture(enum AVPixelFormat,int,int)" (?alloc_picture@@YAPEAUAVFrame@@W4AVPixelFormat@@HH@Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol av_free referenced in function "struct AVFrame * __cdecl alloc_picture(enum AVPixelFormat,int,int)" (?alloc_picture@@YAPEAUAVFrame@@W4AVPixelFormat@@HH@Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol av_freep referenced in function "void __cdecl aviCloseWriter(struct tagAVIWriter *)" (?aviCloseWriter@@YAXPEAUtagAVIWriter@@@Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol av_rescale_q referenced in function "void __cdecl aviWriteFrame(struct tagAVIWriter *,unsigned char *)" (?aviWriteFrame@@YAXPEAUtagAVIWriter@@PEAE@Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol av_frame_alloc referenced in function "struct AVFrame * __cdecl alloc_picture(enum AVPixelFormat,int,int)" (?alloc_picture@@YAPEAUAVFrame@@W4AVPixelFormat@@HH@Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol avcodec_open2 referenced in function "void __cdecl initiate_avi_create(struct tagAVIWriter *,int,int)" (?initiate_avi_create@@YAXPEAUtagAVIWriter@@HH@Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol avcodec_close referenced in function "void __cdecl aviCloseReader(struct tagAVIReader *)" (?aviCloseReader@@YAXPEAUtagAVIReader@@@Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol av_init_packet referenced in function "void __cdecl aviWriteFrame(struct tagAVIWriter *,unsigned char *)" (?aviWriteFrame@@YAXPEAUtagAVIWriter@@PEAE@Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol av_free_packet referenced in function "void __cdecl aviReadFrame(struct tagAVIReader *,unsigned char *,int)" (?aviReadFrame@@YAXPEAUtagAVIReader@@PEAEH@Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol avcodec_find_decoder referenced in function "void __cdecl initiate_avi_open(struct tagAVIReader *)" (?initiate_avi_open@@YAXPEAUtagAVIReader@@@Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol avcodec_decode_video2 referenced in function "void __cdecl aviReadFrame(struct tagAVIReader *,unsigned char *,int)" (?aviReadFrame@@YAXPEAUtagAVIReader@@PEAEH@Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol avcodec_find_encoder referenced in function "void __cdecl initiate_avi_create(struct tagAVIWriter *,int,int)" (?initiate_avi_create@@YAXPEAUtagAVIWriter@@HH@Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol avcodec_find_encoder_by_name referenced in function "void __cdecl initiate_avi_create(struct tagAVIWriter *,int,int)" (?initiate_avi_create@@YAXPEAUtagAVIWriter@@HH@Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol avcodec_encode_video referenced in function "void __cdecl aviWriteFrame(struct tagAVIWriter *,unsigned char *)" (?aviWriteFrame@@YAXPEAUtagAVIWriter@@PEAE@Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol avpicture_fill referenced in function "struct AVFrame * __cdecl alloc_picture(enum AVPixelFormat,int,int)" (?alloc_picture@@YAPEAUAVFrame@@W4AVPixelFormat@@HH@Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol avpicture_get_size referenced in function "struct AVFrame * __cdecl alloc_picture(enum AVPixelFormat,int,int)" (?alloc_picture@@YAPEAUAVFrame@@W4AVPixelFormat@@HH@Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol sws_getContext referenced in function "void __cdecl initiate_avi_create(struct tagAVIWriter *,int,int)" (?initiate_avi_create@@YAXPEAUtagAVIWriter@@HH@Z)
1>ffmpeg_io.obj : error LNK2019: unresolved external symbol sws_scale referenced in function "void __cdecl aviReadFrame(struct tagAVIReader *,unsigned char *,int)" (?aviReadFrame@@YAXPEAUtagAVIReader@@PEAEH@Z)
1>tiff_io.obj : error LNK2019: unresolved external symbol TIFFClose referenced in function "void __cdecl tiffReadRGBA(char *,int *,int *,unsigned char *)" (?tiffReadRGBA@@YAXPEADPEAH1PEAE@Z)
1>tiff_io.obj : error LNK2019: unresolved external symbol TIFFGetField referenced in function "void __cdecl tiffReadRGBA(char *,int *,int *,unsigned char *)" (?tiffReadRGBA@@YAXPEADPEAH1PEAE@Z)
1>tiff_io.obj : error LNK2019: unresolved external symbol TIFFSetField referenced in function "void __cdecl tiffWriteRGBA(char *,int,int,unsigned char *)" (?tiffWriteRGBA@@YAXPEADHHPEAE@Z)
1>tiff_io.obj : error LNK2019: unresolved external symbol TIFFReadRGBAImage referenced in function "void __cdecl tiffReadRGBA(char *,int *,int *,unsigned char *)" (?tiffReadRGBA@@YAXPEADPEAH1PEAE@Z)
1>tiff_io.obj : error LNK2019: unresolved external symbol TIFFOpen referenced in function "void __cdecl tiffReadRGBA(char *,int *,int *,unsigned char *)" (?tiffReadRGBA@@YAXPEADPEAH1PEAE@Z)
1>tiff_io.obj : error LNK2019: unresolved external symbol TIFFWriteEncodedStrip referenced in function "void __cdecl tiffWriteRGBA(char *,int,int,unsigned char *)" (?tiffWriteRGBA@@YAXPEADHHPEAE@Z)
1>Video.obj : error LNK2019: unresolved external symbol "void __cdecl DCT2d(double *,double *,long,long)" (?DCT2d@@YAXPEAN0JJ@Z) referenced in function "void __cdecl ForwardDCT(class DataShuffle *,unsigned char *,char *,int,int,int,int,int,bool)" (?ForwardDCT@@YAXPEAVDataShuffle@@PEAEPEADHHHHH_N@Z)
1>Video.obj : error LNK2019: unresolved external symbol "void __cdecl IDCT2d(double *,double *,long,long)" (?IDCT2d@@YAXPEAN0JJ@Z) referenced in function "void __cdecl ExportVideoFromDCT(class DataShuffle *,char *,char *,int,int,int,int)" (?ExportVideoFromDCT@@YAXPEAVDataShuffle@@PEAD1HHHH@Z)
1>Video.obj : error LNK2019: unresolved external symbol "void __cdecl CopyToZigZag(double *,double *,long,long,long)" (?CopyToZigZag@@YAXPEAN0JJJ@Z) referenced in function "void __cdecl ForwardDCT(class DataShuffle *,unsigned char *,char *,int,int,int,int,int,bool)" (?ForwardDCT@@YAXPEAVDataShuffle@@PEAEPEADHHHHH_N@Z)
1>Video.obj : error LNK2019: unresolved external symbol "void __cdecl CopyFromZigZag(double *,double *,long,long,long)" (?CopyFromZigZag@@YAXPEAN0JJJ@Z) referenced in function "void __cdecl ExportVideoFromDCT(class DataShuffle *,char *,char *,int,int,int,int)" (?ExportVideoFromDCT@@YAXPEAVDataShuffle@@PEAD1HHHH@Z)

最佳答案

您还必须链接其他 FFmpeg 库(avcodec、avutil 等)。 libtiff 也一样。

关于c++ - 在Visual Studio 2013终极项目中使用FFMPEG,链接错误LNK2019,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29296974/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com