mpeg2ts
mpeg2ts copied to clipboard
Linking failure on recent shared library build
Creating library C:/MySpace/Projects/mpeg2ts/build_dll/libs/mpeg2ts/Debug/mpeg2ts-d.lib and object C:/MySpace/Proj
ects/mpeg2ts/build_dll/libs/mpeg2ts/Debug/mpeg2ts-d.exp mpeg2ts.vcxproj -> C:\MySpace\Projects\mpeg2ts\build_dll\libs\mpeg2ts\Debug\mpeg2ts-d.dll Building Custom Rule C:/MySpace/Projects/mpeg2ts/samples/TsUtilities/CMakeLists.txt main.cpp LINK : fatal error LNK1104: cannot open file '....\libs\mpeg2codec\Debug\mpeg2codec-d.lib' [C:\MySpace\Projects\mpeg2t s\build_dll\samples\TsUtilities\sample_tsutilities.vcxproj]
Manually copy the library
PS C:\MySpace\Projects\mpeg2ts\build_dll> cmake --build . Microsoft (R) Build Engine version 17.2.1+52cd2da31 for .NET Framework Copyright (C) Microsoft Corporation. All rights reserved.
common.vcxproj -> C:\MySpace\Projects\mpeg2ts\build_dll\libs\common\Debug\common-d.lib h264codec.vcxproj -> C:\MySpace\Projects\mpeg2ts\build_dll\libs\h264codec\Debug\h264codec-d.dll mpeg2codec.vcxproj -> C:\MySpace\Projects\mpeg2ts\build_dll\libs\mpeg2codec\Debug\mpeg2codec-d.dll mpeg2ts.vcxproj -> C:\MySpace\Projects\mpeg2ts\build_dll\libs\mpeg2ts\Debug\mpeg2ts-d.dll LINK : fatal error LNK1104: cannot open file '....\libs\mpeg2codec\Debug\mpeg2codec-d.lib' [C:\MySpace\Projects\mpeg2t s\build_dll\samples\TsUtilities\sample_tsutilities.vcxproj]
Manually copy the library
PS C:\MySpace\Projects\mpeg2ts\build_dll> cmake --build . Microsoft (R) Build Engine version 17.2.1+52cd2da31 for .NET Framework Copyright (C) Microsoft Corporation. All rights reserved.
common.vcxproj -> C:\MySpace\Projects\mpeg2ts\build_dll\libs\common\Debug\common-d.lib
h264codec.vcxproj -> C:\MySpace\Projects\mpeg2ts\build_dll\libs\h264codec\Debug\h264codec-d.dll
mpeg2codec.vcxproj -> C:\MySpace\Projects\mpeg2ts\build_dll\libs\mpeg2codec\Debug\mpeg2codec-d.dll
mpeg2ts.vcxproj -> C:\MySpace\Projects\mpeg2ts\build_dll\libs\mpeg2ts\Debug\mpeg2ts-d.dll
LINK : fatal error LNK1104: cannot open file '....\libs\h264codec\Debug\h264codec-d.lib' [C:\MySpace\Projects\mpeg2ts
build_dll\samples\TsUtilities\sample_tsutilities.vcxproj]
Manually copy the library PS C:\MySpace\Projects\mpeg2ts\build_dll> cmake --build . Microsoft (R) Build Engine version 17.2.1+52cd2da31 for .NET Framework Copyright (C) Microsoft Corporation. All rights reserved.
common.vcxproj -> C:\MySpace\Projects\mpeg2ts\build_dll\libs\common\Debug\common-d.lib h264codec.vcxproj -> C:\MySpace\Projects\mpeg2ts\build_dll\libs\h264codec\Debug\h264codec-d.dll mpeg2codec.vcxproj -> C:\MySpace\Projects\mpeg2ts\build_dll\libs\mpeg2codec\Debug\mpeg2codec-d.dll mpeg2ts.vcxproj -> C:\MySpace\Projects\mpeg2ts\build_dll\libs\mpeg2ts\Debug\mpeg2ts-d.dll mpeg2codec-d.lib(Mpeg2Codec.obj) : error LNK2019: unresolved external symbol "public: __cdecl GetBits::GetBits(void)" ( ??0GetBits@@QEAA@XZ) referenced in function "public: __cdecl mpeg2::Mpeg2VideoEsParser::Mpeg2VideoEsParser(void)" (??0M peg2VideoEsParser@mpeg2@@QEAA@XZ) [C:\MySpace\Projects\mpeg2ts\build_dll\samples\TsUtilities\sample_tsutilities.vcxproj ] h264codec-d.lib(H264Codec.obj) : error LNK2001: unresolved external symbol "public: __cdecl GetBits::GetBits(void)" (?? 0GetBits@@QEAA@XZ) [C:\MySpace\Projects\mpeg2ts\build_dll\samples\TsUtilities\sample_tsutilities.vcxproj] mpeg2codec-d.lib(Mpeg2VideoParser.obj) : error LNK2019: unresolved external symbol "public: unsigned __int64 __cdecl Ge tBits::getBits(int)" (?getBits@GetBits@@QEAA_KH@Z) referenced in function "public: class std::vector<struct mpeg2::EsIn foMpeg2,class std::allocator<struct mpeg2::EsInfoMpeg2> > __cdecl mpeg2::Mpeg2VideoEsParser::analyze(void)" (?analyze@M peg2VideoEsParser@mpeg2@@QEAA?AV?$vector@UEsInfoMpeg2@mpeg2@@V?$allocator@UEsInfoMpeg2@mpeg2@@@std@@@std@@XZ) [C:\MySpa ce\Projects\mpeg2ts\build_dll\samples\TsUtilities\sample_tsutilities.vcxproj] h264codec-d.lib(H264Parser.obj) : error LNK2001: unresolved external symbol "public: unsigned __int64 __cdecl GetBits:: getBits(int)" (?getBits@GetBits@@QEAA_KH@Z) [C:\MySpace\Projects\mpeg2ts\build_dll\samples\TsUtilities\sample_tsutiliti es.vcxproj] mpeg2codec-d.lib(Mpeg2VideoParser.obj) : error LNK2019: unresolved external symbol "public: void __cdecl GetBits::reset Bits(unsigned char const *,unsigned __int64,unsigned __int64)" (?resetBits@GetBits@@QEAAXPEBE_K1@Z) referenced in funct ion "public: class std::vector<struct mpeg2::EsInfoMpeg2,class std::allocator<struct mpeg2::EsInfoMpeg2> > __cdecl mpeg 2::Mpeg2VideoEsParser::analyze(void)" (?analyze@Mpeg2VideoEsParser@mpeg2@@QEAA?AV?$vector@UEsInfoMpeg2@mpeg2@@V?$alloca tor@UEsInfoMpeg2@mpeg2@@@std@@@std@@XZ) [C:\MySpace\Projects\mpeg2ts\build_dll\samples\TsUtilities\sample_tsutilities.v cxproj] h264codec-d.lib(H264Parser.obj) : error LNK2001: unresolved external symbol "public: void __cdecl GetBits::resetBits(un signed char const *,unsigned __int64,unsigned __int64)" (?resetBits@GetBits@@QEAAXPEBE_K1@Z) [C:\MySpace\Projects\mpeg2 ts\build_dll\samples\TsUtilities\sample_tsutilities.vcxproj] mpeg2codec-d.lib(Mpeg2VideoParser.obj) : error LNK2019: unresolved external symbol "public: void __cdecl GetBits::skipB its(int)" (?skipBits@GetBits@@QEAAXH@Z) referenced in function "public: class std::vector<struct mpeg2::EsInfoMpeg2,cla ss std::allocator<struct mpeg2::EsInfoMpeg2> > __cdecl mpeg2::Mpeg2VideoEsParser::analyze(void)" (?analyze@Mpeg2VideoEs Parser@mpeg2@@QEAA?AV?$vector@UEsInfoMpeg2@mpeg2@@V?$allocator@UEsInfoMpeg2@mpeg2@@@std@@@std@@XZ) [C:\MySpace\Projects \mpeg2ts\build_dll\samples\TsUtilities\sample_tsutilities.vcxproj] h264codec-d.lib(H264Parser.obj) : error LNK2001: unresolved external symbol "public: void __cdecl GetBits::skipBits(int )" (?skipBits@GetBits@@QEAAXH@Z) [C:\MySpace\Projects\mpeg2ts\build_dll\samples\TsUtilities\sample_tsutilities.vcxproj] C:\MySpace\Projects\mpeg2ts\build_dll\samples\TsUtilities\Debug\sample_tsutilities.exe : fatal error LNK1120: 4 unresol ved externals [C:\MySpace\Projects\mpeg2ts\build_dll\samples\TsUtilities\sample_tsutilities.vcxproj] PS C:\MySpace\Projects\mpeg2ts\build_dll>
Dear @AnshulYbd Thanks for your Issue! I wonder which IDE you are using and if you used visual studio (also if you generate the visual studio solution file)? How did you configure via CMake?
I can build and run the samples on Windows 10 with for example Visual Studio 2022 that supports CMake (You need install CMake support) so I am not sure how to reproduce your issue.
Thank you! Kind regards Kohnech