Closed Mbadra96 closed 1 year ago
Hi, thanks for the issue. We just had a similar issue come up in the community discord and it looks like this is happening because I gave bad instructions in the readme that compile 32-bit binaries for ffmpeg.
You can resolve this by launching the x86_x64 Cross Tools Command Prompt for VS 2022
when opening the VS dev tools. This will make sure that you compile the 64-bit binaries. This will be updated in master as soon as I merge a WIP branch :)
I followed the instuctions in the readme.md closly but these errors are still occurring more me. I don't understand the fix you've outlined here.
First of all, Thank you for your great work, It is really remarkable. I followed your installation steps but unfortunately, I couldn't complete building the solution because of linking error with the FFmpeg library (I guess) as it popped up from the "Encoder.obj", as shown below:
5>Encoder.obj : error LNK2019: unresolved external symbol av_strerror referenced in function av_make_error_string 5>Encoder.obj : error LNK2019: unresolved external symbol av_frame_alloc referenced in function "bool cdecl MathAnim::VideoWriter::pushFrame(struct MathAnim::Pixel *,int,struct MathAnim::VideoEncoder &)" (?pushFrame@VideoWriter@MathAnim@@YA_NPEAUPixel@2@HAEAUVideoEncoder@2@@Z) 5>Encoder.obj : error LNK2019: unresolved external symbol av_frame_free referenced in function "void __cdecl MathAnim::VideoWriter::freeEncoder(struct MathAnim::VideoEncoder &)" (?freeEncoder@VideoWriter@MathAnim@@YAXAEAUVideoEncoder@2@@Z) 5>Encoder.obj : error LNK2019: unresolved external symbol av_frame_get_buffer referenced in function "bool cdecl MathAnim::VideoWriter::pushFrame(struct MathAnim::Pixel ,int,struct MathAnim::VideoEncoder &)" (?pushFrame@VideoWriter@MathAnim@@YA_NPEAUPixel@2@HAEAUVideoEncoder@2@@Z) 5>Encoder.obj : error LNK2019: unresolved external symbol avcodec_find_encoder referenced in function "bool __cdecl MathAnim::VideoWriter::startEncodingFile(struct MathAnim::VideoEncoder ,char const ,int,int,int,int,bool)" (?startEncodingFile@VideoWriter@MathAnim@@YA_NPEAUVideoEncoder@2@PEBDHHHH_N@Z) 5>Encoder.obj : error LNK2019: unresolved external symbol av_init_packet referenced in function "bool cdecl MathAnim::VideoWriter::encodePacket(struct MathAnim::VideoEncoder &)" (?encodePacket@VideoWriter@MathAnim@@YA_NAEAUVideoEncoder@2@@Z) 5>Encoder.obj : error LNK2019: unresolved external symbol av_packet_unref referenced in function "bool __cdecl MathAnim::VideoWriter::encodePacket(struct MathAnim::VideoEncoder &)" (?encodePacket@VideoWriter@MathAnim@@YA_NAEAUVideoEncoder@2@@Z) 5>Encoder.obj : error LNK2019: unresolved external symbol avcodec_alloc_context3 referenced in function "bool cdecl MathAnim::VideoWriter::startEncodingFile(struct MathAnim::VideoEncoder ,char const ,int,int,int,int,bool)" (?startEncodingFile@VideoWriter@MathAnim@@YA_NPEAUVideoEncoder@2@PEBDHHHH_N@Z) 5>Encoder.obj : error LNK2019: unresolved external symbol avcodec_free_context referenced in function "void __cdecl MathAnim::VideoWriter::freeEncoder(struct MathAnim::VideoEncoder &)" (?freeEncoder@VideoWriter@MathAnim@@YAXAEAUVideoEncoder@2@@Z) 5>Encoder.obj : error LNK2019: unresolved external symbol avcodec_parameters_from_context referenced in function "bool __cdecl MathAnim::VideoWriter::startEncodingFile(struct MathAnim::VideoEncoder ,char const ,int,int,int,int,bool)" (?startEncodingFile@VideoWriter@MathAnim@@YA_NPEAUVideoEncoder@2@PEBDHHHH_N@Z) 5>Encoder.obj : error LNK2019: unresolved external symbol avcodec_parameters_to_context referenced in function "bool __cdecl MathAnim::VideoWriter::startEncodingFile(struct MathAnim::VideoEncoder ,char const ,int,int,int,int,bool)" (?startEncodingFile@VideoWriter@MathAnim@@YA_NPEAUVideoEncoder@2@PEBDHHHH_N@Z) 5>Encoder.obj : error LNK2019: unresolved external symbol avcodec_open2 referenced in function "bool __cdecl MathAnim::VideoWriter::startEncodingFile(struct MathAnim::VideoEncoder ,char const ,int,int,int,int,bool)" (?startEncodingFile@VideoWriter@MathAnim@@YA_NPEAUVideoEncoder@2@PEBDHHHH_N@Z) 5>Encoder.obj : error LNK2019: unresolved external symbol avcodec_send_frame referenced in function "bool cdecl MathAnim::VideoWriter::encodePacket(struct MathAnim::VideoEncoder &)" (?encodePacket@VideoWriter@MathAnim@@YA_NAEAUVideoEncoder@2@@Z) 5>Encoder.obj : error LNK2019: unresolved external symbol avcodec_receive_packet referenced in function "bool __cdecl MathAnim::VideoWriter::encodePacket(struct MathAnim::VideoEncoder &)" (?encodePacket@VideoWriter@MathAnim@@YA_NAEAUVideoEncoder@2@@Z) 5>Encoder.obj : error LNK2019: unresolved external symbol av_opt_set referenced in function "bool cdecl MathAnim::VideoWriter::startEncodingFile(struct MathAnim::VideoEncoder ,char const ,int,int,int,int,bool)" (?startEncodingFile@VideoWriter@MathAnim@@YA_NPEAUVideoEncoder@2@PEBDHHHH_N@Z) 5>Encoder.obj : error LNK2019: unresolved external symbol avio_open referenced in function "bool __cdecl MathAnim::VideoWriter::startEncodingFile(struct MathAnim::VideoEncoder ,char const ,int,int,int,int,bool)" (?startEncodingFile@VideoWriter@MathAnim@@YA_NPEAUVideoEncoder@2@PEBDHHHH_N@Z) 5>Encoder.obj : error LNK2019: unresolved external symbol avio_close referenced in function "bool __cdecl MathAnim::VideoWriter::finalizeEncodingFile(struct MathAnim::VideoEncoder &)" (?finalizeEncodingFile@VideoWriter@MathAnim@@YA_NAEAUVideoEncoder@2@@Z) 5>Encoder.obj : error LNK2019: unresolved external symbol avformat_free_context referenced in function "void cdecl MathAnim::VideoWriter::freeEncoder(struct MathAnim::VideoEncoder &)" (?freeEncoder@VideoWriter@MathAnim@@YAXAEAUVideoEncoder@2@@Z) 5>Encoder.obj : error LNK2019: unresolved external symbol avformat_new_stream referenced in function "bool cdecl MathAnim::VideoWriter::startEncodingFile(struct MathAnim::VideoEncoder ,char const ,int,int,int,int,bool)" (?startEncodingFile@VideoWriter@MathAnim@@YA_NPEAUVideoEncoder@2@PEBDHHHH_N@Z) 5>Encoder.obj : error LNK2019: unresolved external symbol avformat_alloc_output_context2 referenced in function "bool __cdecl MathAnim::VideoWriter::startEncodingFile(struct MathAnim::VideoEncoder ,char const ,int,int,int,int,bool)" (?startEncodingFile@VideoWriter@MathAnim@@YA_NPEAUVideoEncoder@2@PEBDHHHH_N@Z) 5>Encoder.obj : error LNK2019: unresolved external symbol avformat_write_header referenced in function "bool __cdecl MathAnim::VideoWriter::startEncodingFile(struct MathAnim::VideoEncoder ,char const ,int,int,int,int,bool)" (?startEncodingFile@VideoWriter@MathAnim@@YA_NPEAUVideoEncoder@2@PEBDHHHH_N@Z) 5>Encoder.obj : error LNK2019: unresolved external symbol av_interleaved_write_frame referenced in function "bool cdecl MathAnim::VideoWriter::encodePacket(struct MathAnim::VideoEncoder &)" (?encodePacket@VideoWriter@MathAnim@@YA_NAEAUVideoEncoder@2@@Z) 5>Encoder.obj : error LNK2019: unresolved external symbol av_write_trailer referenced in function "bool __cdecl MathAnim::VideoWriter::finalizeEncodingFile(struct MathAnim::VideoEncoder &)" (?finalizeEncodingFile@VideoWriter@MathAnim@@YA_NAEAUVideoEncoder@2@@Z) 5>Encoder.obj : error LNK2019: unresolved external symbol av_guess_format referenced in function "bool cdecl MathAnim::VideoWriter::startEncodingFile(struct MathAnim::VideoEncoder ,char const ,int,int,int,int,bool)" (?startEncodingFile@VideoWriter@MathAnim@@YA_NPEAUVideoEncoder@2@PEBDHHHH_N@Z) 5>Encoder.obj : error LNK2019: unresolved external symbol av_dump_format referenced in function "bool __cdecl MathAnim::VideoWriter::startEncodingFile(struct MathAnim::VideoEncoder ,char const ,int,int,int,int,bool)" (?startEncodingFile@VideoWriter@MathAnim@@YA_NPEAUVideoEncoder@2@PEBDHHHH_N@Z) 5>Encoder.obj : error LNK2019: unresolved external symbol sws_freeContext referenced in function "void __cdecl MathAnim::VideoWriter::freeEncoder(struct MathAnim::VideoEncoder &)" (?freeEncoder@VideoWriter@MathAnim@@YAXAEAUVideoEncoder@2@@Z) 5>Encoder.obj : error LNK2019: unresolved external symbol sws_getContext referenced in function "bool __cdecl MathAnim::VideoWriter::pushFrame(struct MathAnim::Pixel ,int,struct MathAnim::VideoEncoder &)" (?pushFrame@VideoWriter@MathAnim@@YA_NPEAUPixel@2@HAEAUVideoEncoder@2@@Z) 5>Encoder.obj : error LNK2019: unresolved external symbol sws_scale referenced in function "bool __cdecl MathAnim::VideoWriter::pushFrame(struct MathAnim::Pixel *,int,struct MathAnim::VideoEncoder &)" (?pushFrame@VideoWriter@MathAnim@@YA_NPEAUPixel@2@HAEAUVideoEncoder@2@@Z) 5>Animations\vendor\ffmpeg\build\lib\libavformat.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64' 5>Animations\vendor\ffmpeg\build\lib\libavcodec.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64' 5>Animations\vendor\ffmpeg\build\lib\libavdevice.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64' 5>Animations\vendor\ffmpeg\build\lib\libavfilter.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64' 5>Animations\vendor\ffmpeg\build\lib\libswresample.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64' 5>Animations\vendor\ffmpeg\build\lib\libswscale.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64' 5>Animations\vendor\ffmpeg\build\lib\libavutil.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
The FFmpeg library was built successfully