Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linking failure on recent shared library build #53

Open
AnshulYbd opened this issue Jul 20, 2022 · 1 comment
Open

Linking failure on recent shared library build #53

AnshulYbd opened this issue Jul 20, 2022 · 1 comment
Assignees

Comments

@AnshulYbd
Copy link

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 > __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 > __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 > __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>

@kohnech kohnech self-assigned this Aug 25, 2022
@kohnech
Copy link
Contributor

kohnech commented Aug 25, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants