0

This is what it looks like:

'''

extern "C"
{
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"
#include "libavutil/avutil.h"
};

'''

But I still get these errors when using the FFmpeg libraries in Visual Studio 2019

1>AudioFile.obj : error LNK2001: unresolved external symbol avformat_open_input
1>AudioFile.obj : error LNK2001: unresolved external symbol av_read_frame
1>AudioFile.obj : error LNK2001: unresolved external symbol av_free
1>AudioFile.obj : error LNK2001: unresolved external symbol av_get_sample_fmt_name
1>AudioFile.obj : error LNK2001: unresolved external symbol avformat_close_input
1>AudioFile.obj : error LNK2001: unresolved external symbol av_init_packet
1>AudioFile.obj : error LNK2001: unresolved external symbol avcodec_receive_frame
1>AudioFile.obj : error LNK2001: unresolved external symbol avcodec_open2
1>AudioFile.obj : error LNK2001: unresolved external symbol av_sample_fmt_is_planar
1>AudioFile.obj : error LNK2001: unresolved external symbol avcodec_close
1>AudioFile.obj : error LNK2001: unresolved external symbol av_get_bytes_per_sample
1>AudioFile.obj : error LNK2001: unresolved external symbol av_packet_unref
1>AudioFile.obj : error LNK2001: unresolved external symbol avformat_find_stream_info
1>AudioFile.obj : error LNK2001: unresolved external symbol av_find_best_stream
1>AudioFile.obj : error LNK2001: unresolved external symbol av_frame_alloc

I would be greatfull to anyone who could help me resolve this. I am using C++ for Windows.

  • Why did you wrapped `#include`s with `extern "C"`? Did you add the libraries in linker settings? – paxbun Feb 01 '20 at 08:38
  • The FFMPEG files are C files, so the need to be wrapped before they could be used in C++. But this results in errors too. – Faizan Cassim Feb 01 '20 at 08:39
  • 1
    `extern "C"` is not used to indicate that the library is written in C. It is used to prevent name mangling. Could you please capture your VS project settings and upload the image? – paxbun Feb 01 '20 at 08:41

0 Answers0