Compiling OCC 7.4.0: unresolved external symbols

Hello,

I am trying to build OCC 7.4.0 on Windows 10 using Visual Studio 2017 for x64 and everything compile fine except for the Media lib, which I have to following unresolved message:

1>Media_CodecContext.obj : error LNK2019: unresolved external symbol avcodec_free_context referenced in function "public: virtual __cdecl Media_CodecContext::~Media_CodecContext(void)" (??1Media_CodecContext@@UEAA@XZ)
1>Media_CodecContext.obj : error LNK2019: unresolved external symbol avcodec_parameters_to_context referenced in function "public: bool __cdecl Media_CodecContext::Init(struct AVStream const &,double,int,int)" (?Init@Media_CodecContext@@QEAA_NAEBUAVStream@@NHH@Z)
1>Media_CodecContext.obj : error LNK2019: unresolved external symbol avcodec_send_packet referenced in function "public: bool __cdecl Media_CodecContext::SendPacket(class opencascade::handle<class Media_Packet> const &)" (?SendPacket@Media_CodecContext@@QEAA_NAEBV?$handle@VMedia_Packet@@@opencascade@@@Z)
1>Media_CodecContext.obj : error LNK2019: unresolved external symbol avcodec_receive_frame referenced in function "public: bool __cdecl Media_CodecContext::ReceiveFrame(class opencascade::handle<class Media_Frame> const &)" (?ReceiveFrame@Media_CodecContext@@QEAA_NAEBV?$handle@VMedia_Frame@@@opencascade@@@Z)
1>Media_Packet.obj : error LNK2019: unresolved external symbol av_packet_alloc referenced in function "public: __cdecl Media_Packet::Media_Packet(void)" (??0Media_Packet@@QEAA@XZ)
1>Media_Packet.obj : error LNK2019: unresolved external symbol av_packet_free referenced in function "public: virtual __cdecl Media_Packet::~Media_Packet(void)" (??1Media_Packet@@UEAA@XZ)
1>Media_Packet.obj : error LNK2019: unresolved external symbol av_packet_unref referenced in function "public: void __cdecl Media_Packet::Unref(void)" (?Unref@Media_Packet@@QEAAXXZ)
1>C:\OCC\occt-740-build-vc14-x64\win64\vc14\bin\TKService.dll : fatal error LNK1120: 7 unresolved externals
1>Done building project "TKService.vcxproj" -- FAILED.

I have look at the Visual Studio project and everything look fine, the ffmpeg-3.3-64 includes and libs are correctly defined.

Anyone had this problem?

Best regards,

François.

 

 

Kirill Gavrilov's picture

This is because ffmpeg-3.3-64 from "3rd-party" page lacks some symbols used by OCCT 7.4.0. The page should be updated.
https://www.opencascade.com/content/3rd-party-components

Kirill Gavrilov's picture

Please try with updated FFmpeg 3.3.4 on the page.

Francois Lauzon's picture

Thanks Kirill,

I will reconfigure CMake and relauch the build with the FFmpeg libs and post here later if it resolve my issue or not.

François.

Francois Lauzon's picture

Problem solve using the new libs,

Thanks,

François.

Fengwei Ping's picture

The ffmpeg-3.3.4-64 has been included in the OCC 7.4.0-vc14-64, after adding the including and library directories, I have built the codes on windows10 vs2017.

mustap_161726's picture

I tried the ffmpeg 3.3.4 libraries.  it didn't work.  I'm building opencascade-7.5.0 in msvc (2019).

I even built ffmpeg-4.3.1 libraries.  The problem wasn't resolved. 

I get 61 LNK errors.  All in TKService.

mustap_161726's picture

HI,

I'm still struggling with these errors.  Please see attached VS output.

Any help will be appreciated.  Regards

Attachments: