For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

Compiling OCC 7.4.0: unresolved external symbols

Francois Lauzon's picture

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.