Building/Linking webrtc VideoDecoderFactory/VideoEncoderFactory

304 views
Skip to first unread message

larry

unread,
Mar 15, 2024, 7:41:56 AMMar 15
to discuss-webrtc
I am currently building webrtc from source on windows, and getting various link errors (the peer2peer example did work with slight modification found online (only the audio worked),  so i am assuming that building on windows is possible)?

what i have tried
r5483
prebuild can be found online, it did link and run
but it is built with proprietary_codecs=false

r5735

find 2 repo using this version of webrtc.lib, but i get 
Error: Command 'git -c core.deltaBaseCacheLimit=2g fetch origin debe7d2d1982e540fbd6bd78604bf001753f9e74 --no-tags' returned non-zero exit status 128 in ..\src\third_party\libFuzzer\src
during gclient sync, r5650 is the same

r5850 r6125 r6340 r6355:

gn gen ../../build/release_x64_static_libwebrtc --args='is_debug=false use_custom_libcxx=false treat_warnings_as_errors=false rtc_include_tests=false rtc_enable_protobuf=false rtc_build_tools=false use_rtti=true use_lld=false'
preprocessor: WEBRTC_WIN _WINDOWS NOMINMAX
libs: webrtc.lib avcodec.lib avutil.lib advapi32.lib wmcodecdspuuid.lib winmm.lib crypt32.lib iphlpapi.lib secur32.lib msdmo.lib user32.lib strmiids.lib dmoguids.lib amstrmid.lib

without use_custom_libcxx=false, i get 78 link error and most of the builds online have use_clang=false, but all the branches i tried fails to build with it

[1/2] Building CXX object c_cpp\webrtc_test\CMakeFiles\webrtc_test.dir\main.cpp.obj webrtc\src\rtc_base/stream.h: warning C4068: unknown pragma 'clang' [2/2] Linking CXX executable c_cpp\webrtc_test\webrtc_test.exe FAILED: c_cpp/webrtc_test/webrtc_test.exe cmd.exe /C "cd . && "C:\Program Files\JetBrains\CLion 2023.3.2\bin\cmake\win\x64\bin\cmake.exe" -E vs_link_exe --intdir=c_cpp\webrtc_test\CMakeFiles\webrtc_test.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\mt.exe --manifests -- C:\PROGRA~1\MICROS~2\2022\COMMUN~1\VC\Tools\MSVC\1438~1.331\bin\Hostx64\x64\link.exe /nologo c_cpp\webrtc_test\CMakeFiles\webrtc_test.dir\main.cpp.obj /out:c_cpp\webrtc_test\webrtc_test.exe /implib:c_cpp\webrtc_test\webrtc_test.lib /pdb:c_cpp\webrtc_test\webrtc_test.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:console -LIBPATH:clibs\build\webrtc\obj -LIBPATH:clibs\build\webrtc\obj\third_party\boringssl -LIBPATH:clibs\build\webrtc\obj\third_party\libyuv -LIBPATH:clibs\build\release_x64_ffmpeg_6.1\lib webrtc.lib avcodec.lib avutil.lib advapi32.lib wmcodecdspuuid.lib winmm.lib crypt32.lib iphlpapi.lib secur32.lib msdmo.lib user32.lib strmiids.lib dmoguids.lib comdlg32.lib dbghelp.lib dnsapi.lib gdi32.lib msimg32.lib odbc32.lib odbccp32.lib oleaut32.lib shell32.lib shlwapi.lib usp10.lib uuid.lib version.lib wininet.lib winspool.lib ws2_32.lib delayimp.lib kernel32.lib ole32.lib amstrmid.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."LINK: command "C:\PROGRA~1\MICROS~2\2022\COMMUN~1\VC\Tools\MSVC\1438~1.331\bin\Hostx64\x64\link.exe /nologo c_cpp\webrtc_test\CMakeFiles\webrtc_test.dir\main.cpp.obj /out:c_cpp\webrtc_test\webrtc_test.exe /implib:c_cpp\webrtc_test\webrtc_test.lib /pdb:c_cpp\webrtc_test\webrtc_test.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:console -LIBPATH:clibs\build\webrtc\obj -LIBPATH:clibs\build\webrtc\obj\third_party\boringssl -LIBPATH:clibs\build\webrtc\obj\third_party\libyuv -LIBPATH:clibs\build\release_x64_ffmpeg_6.1\lib webrtc.lib avcodec.lib avutil.lib advapi32.lib wmcodecdspuuid.lib winmm.lib crypt32.lib iphlpapi.lib secur32.lib msdmo.lib user32.lib strmiids.lib dmoguids.lib comdlg32.lib dbghelp.lib dnsapi.lib gdi32.lib msimg32.lib odbc32.lib odbccp32.lib oleaut32.lib shell32.lib shlwapi.lib usp10.lib uuid.lib version.lib wininet.lib winspool.lib ws2_32.lib delayimp.lib kernel32.lib ole32.lib amstrmid.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST:EMBED,ID=1" failed (exit code 1120) with the following outpmain.cpp.obj : error LNK2019: unresolved external symbol "class std::unique_ptr<class webrtc::VideoDecoderFactory,struct std::default_delete<class webrtc::VideoDecoderFactory> > __cdecl webrtc::CreateBuiltinVideoDecoderFactory(void)" (?CreateBuiltinVideoDecoderFactory@webrtc@@YA?AV?$unique_ptr@VVideoDecoderFactory@webrtc@@U?$default_delete@VVideoDecoderFactory@webrtc@@@std@@@std@@XZ) referenced in function "class webrtc::scoped_refptr<class webrtc::PeerConnectionInterface> __cdecl get_peer_connection(class webrtc::PeerConnectionObserver *)" (?get_peer_connection@@YA?AV?$scoped_refptr@VPeerConnectionInterface@webrtc@@@webrtc@@PEAVPeerConnectionObserver@2@@Z) main.cpp.obj : error LNK2019: unresolved external symbol "class std::unique_ptr<class webrtc::VideoEncoderFactory,struct std::default_delete<class webrtc::VideoEncoderFactory> > __cdecl webrtc::CreateBuiltinVideoEncoderFactory(void)" (?CreateBuiltinVideoEncoderFactory@webrtc@@YA?AV?$unique_ptr@VVideoEncoderFactory@webrtc@@U?$default_delete@VVideoEncoderFactory@webrtc@@@std@@@std@@XZ) referenced in function "class webrtc::scoped_refptr<class webrtc::PeerConnectionInterface> __cdecl get_peer_connection(class webrtc::PeerConnectionObserver *)" (?get_peer_connection@@YA?AV?$scoped_refptr@VPeerConnectionInterface@webrtc@@@webrtc@@PEAVPeerConnectionObserver@2@@Z) c_cpp\webrtc_test\webrtc_test.exe : fatal error LNK1120: 2 unresolved externals ninja: build stopped: subcommand failed.

they are mostly the same, other than the output warnings
r5850 generates 'clang' warning in 2 file if preprocessor _WIN32 is not removed
r6340 r6355 always generate 1 'clang' warning in 'stream.h'
r6125 generates 'clang' warning in 7 different files

also sometime i ran into unresolved external symbol PeerConnectionFactoryInterface, AudioDecoderFactory, AudioEncoderFactory, but i don't know why since gn args preprocessor and libs did not change

currently the main.cpp generatess 2-5 link errors, if i compile the peerconnection connection example i get ~40 link error


for mingw
no matter what branch or preprocessor i always get
src/rtc_base/system/rtc_export_template.h:188:37: error: expected primary-expression before '__attribute__' 188 | RTC_EXPORT_TEMPLATE_TEST(MSVC_HACK, __declspec(dllexport)); | src/rtc_base/system/rtc_export_template.h:103:49: error: expected primary-expression before ')' token 103 | RTC_EXPORT_TEMPLATE_##which##_##style(export, ) | ^ src/rtc_base/system/rtc_export_template.h:103:3: error: 'RTC_EXPORT_TEMPLATE_TEST_MSVC_HACK_DEFAULT' was not declared in this scope; did you mean 'RTC_EXPORT_TEMPLATE_DECLARE_DEFAULT'? 103 | RTC_EXPORT_TEMPLATE_##which##_##style(export, ) | ^~~~~~~~~~~~~~~~~~~~
and some other preprocessors i removed (since they do


and some other preprocessors i removed (since they dont do anything thing)
COMPILER_GCC __MINGW64__ COMPILER_MSVC _WIN32 _DEBUG ABSL_ALLOCATOR_NOTHROW=1 CERT_CHAIN_PARA_HAS_EXTRA_F COMPILER_GCC COMPILER_MSVC DYNAMIC_ANNOTATIONS_ENABLED HAVE_SCTP NDEBUG NOMINMAX NTDDI_VERSION=NTDDI_WIN10_R NVALGRIND PSAPI_VERSION=2 RTC_ENABLE_VP9 UNICODE USE_AURA=1 WEBRTC_ENABLE_PROTOBUF=0 WEBRTC_INCLUDE_INTERNAL_AUD WEBRTC_LIBRARY_IMPL WEBRTC_NON_STATIC_TRACE_EVE WEBRTC_VIDEO_CAPTURE_WINRT WEBRTC_WIN WIN10=_WIN32_WINNT_WIN10 WIN32 WIN32_LEAN_AND_MEAN WINAPI_FAMILY=WINAPI_FAMILY WINUWP WINVER=0x0A00 _ATL_NO_OPENGL _CRT_RAND_S _CRT_SECURE_NO_DEPRECATE _CRT_SECURE_NO_WARNINGS _DEBUG _HAS_EXCEPTIONS=0 _HAS_ITERATOR_DEBUGGING=0 _ITERATOR_DEBUG_LEVEL=0 _SCL_SECURE_NO_DEPRECATE _SECURE_ATL _UNICODE _WIN32 _WIN32_WINNT=0x0A00 _WINDOWS __MINGW64__ __STD_C __WRL_NO_DEFAULT_LIB__
Reply all
Reply to author
Forward
0 new messages