A C++ wrapper for binary release, mainly used for flutter-webrtc desktop (windows, linux, embedded).
378
stars
77
forks
source link
External symbols that cannot be resolved appear when some functions are called to link libraries #100
Open
shawn1j opened 1 month ago
I try to build the peerconnect_client in webrtc using libwebrtc and get the following error when I build with MSVC:
[build] C:\windows\system32\cmd.exe /C "cd . && "D:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\peerconnect_client.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 -- "D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\bin\Hostx64\x64\link.exe" /nologo CMakeFiles\peerconnect_client.dir\conductor.cc.obj CMakeFiles\peerconnect_client.dir\defaults.cc.obj CMakeFiles\peerconnect_client.dir\main.cc.obj CMakeFiles\peerconnect_client.dir\main_wnd.cc.obj CMakeFiles\peerconnect_client.dir\peer_connection_client.cc.obj /out:C:\Users\sj2003\Desktop\peerconnect_client\bin\peerconnect_client.exe /implib:peerconnect_client.lib /pdb:C:\Users\sj2003\Desktop\peerconnect_client\bin\peerconnect_client.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:windows winmm.lib ws2_32.lib wmcodecdspuuid.lib msdmo.lib Iphlpapi.lib Strmiids.lib dmoguids.lib C:\Users\sj2003\Desktop\peerconnect_client\lib\libwebrtc.dll.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ." [build] LINK Pass 1: command "D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\bin\Hostx64\x64\link.exe /nologo CMakeFiles\peerconnect_client.dir\conductor.cc.obj CMakeFiles\peerconnect_client.dir\defaults.cc.obj CMakeFiles\peerconnect_client.dir\main.cc.obj CMakeFiles\peerconnect_client.dir\main_wnd.cc.obj CMakeFiles\peerconnect_client.dir\peer_connection_client.cc.obj /out:C:\Users\sj2003\Desktop\peerconnect_client\bin\peerconnect_client.exe /implib:peerconnect_client.lib /pdb:C:\Users\sj2003\Desktop\peerconnect_client\bin\peerconnect_client.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:windows winmm.lib ws2_32.lib wmcodecdspuuid.lib msdmo.lib Iphlpapi.lib Strmiids.lib dmoguids.lib C:\Users\sj2003\Desktop\peerconnect_client\lib\libwebrtc.dll.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\peerconnect_client.dir/intermediate.manifest CMakeFiles\peerconnect_client.dir/manifest.res" failed (exit code 1120) with the following output: [build] conductor.cc.obj : error LNK2019: 无法解析的外部符号 "public: __cdecl cricket::AudioOptions::AudioOptions(void)" (??0AudioOptions@cricket@@QEAA@XZ),函数 "protected: void __cdecl Conductor::AddTracks(void)" (?AddTracks@Conductor@@IEAAXXZ) 中引用了该符号 [build] conductor.cc.obj : error LNK2019: 无法解析的外部符号 "public: __cdecl cricket::AudioOptions::~AudioOptions(void)" (??1AudioOptions@cricket@@QEAA@XZ),函数 "protected: void __cdecl Conductor::AddTracks(void)" (?AddTracks@Conductor@@IEAAXXZ) 中引用了该符号 [build] conductor.cc.obj : error LNK2019: 无法解析的外部符号 "void __cdecl rtc::webrtc_checks_impl::FatalLog(char const *,int,char const *,enum rtc::webrtc_checks_impl::CheckArgType const *,...)" (?FatalLog@webrtc_checks_impl@rtc@@YAXPEBDH0PEBW4CheckArgType@12@ZZ),函数 "public: static void __cdecl rtc::webrtc_checks_impl::LogStreamer<>::Call<>(char const *,int,char const *)" (??$Call@$$V@?$LogStreamer@$$V@webrtc_checks_impl@rtc@@SAXPEBDH0@Z) 中引用了该符号 [build] main.cc.obj : error LNK2001: 无法解析的外部符号 "void __cdecl rtc::webrtc_checks_impl::FatalLog(char const *,int,char const *,enum rtc::webrtc_checks_impl::CheckArgType const *,...)" (?FatalLog@webrtc_checks_impl@rtc@@YAXPEBDH0PEBW4CheckArgType@12@ZZ) [build] main_wnd.cc.obj : error LNK2001: 无法解析的外部符号 "void __cdecl rtc::webrtc_checks_impl::FatalLog(char const *,int,char const *,enum rtc::webrtc_checks_impl::CheckArgType const *,...)" (?FatalLog@webrtc_checks_impl@rtc@@YAXPEBDH0PEBW4CheckArgType@12@ZZ) [build] peer_connection_client.cc.obj : error LNK2001: 无法解析的外部符号 "void __cdecl rtc::webrtc_checks_impl::FatalLog(char const *,int,char const *,enum rtc::webrtc_checks_impl::CheckArgType const *,...)" (?FatalLog@webrtc_checks_impl@rtc@@YAXPEBDH0PEBW4CheckArgType@12@ZZ)
I tried to build the peerconnect_client in webrtc using libwebrtc and got the following error when I built with clang17.03 for MSVC:[build] C:\windows\system32\cmd.exe /C "cd . && "D:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\peerconnect_client.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 -- "D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\Llvm\x64\bin\lld-link.exe" /nologo CMakeFiles\peerconnect_client.dir\conductor.cc.obj CMakeFiles\peerconnect_client.dir\defaults.cc.obj CMakeFiles\peerconnect_client.dir\main.cc.obj CMakeFiles\peerconnect_client.dir\main_wnd.cc.obj CMakeFiles\peerconnect_client.dir\peer_connection_client.cc.obj /out:C:\Users\sj2003\Desktop\peerconnect_client\bin\peerconnect_client.exe /implib:peerconnect_client.lib /pdb:C:\Users\sj2003\Desktop\peerconnect_client\bin\peerconnect_client.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:windows winmm.lib ws2_32.lib wmcodecdspuuid.lib msdmo.lib Iphlpapi.lib Strmiids.lib dmoguids.lib C:\Users\sj2003\Desktop\peerconnect_client\lib\libwebrtc.dll.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ." [build] LINK Pass 1: command "D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\Llvm\x64\bin\lld-link.exe /nologo CMakeFiles\peerconnect_client.dir\conductor.cc.obj CMakeFiles\peerconnect_client.dir\defaults.cc.obj CMakeFiles\peerconnect_client.dir\main.cc.obj CMakeFiles\peerconnect_client.dir\main_wnd.cc.obj CMakeFiles\peerconnect_client.dir\peer_connection_client.cc.obj /out:C:\Users\sj2003\Desktop\peerconnect_client\bin\peerconnect_client.exe /implib:peerconnect_client.lib /pdb:C:\Users\sj2003\Desktop\peerconnect_client\bin\peerconnect_client.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:windows winmm.lib ws2_32.lib wmcodecdspuuid.lib msdmo.lib Iphlpapi.lib Strmiids.lib dmoguids.lib C:\Users\sj2003\Desktop\peerconnect_client\lib\libwebrtc.dll.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\peerconnect_client.dir/intermediate.manifest CMakeFiles\peerconnect_client.dir/manifest.res" failed (exit code 1) with the following output: [build] lld-link: error: undefined symbol: public: static class std::unique_ptr<class rtc::Thread, struct std::default_delete<class rtc::Thread>> __cdecl rtc::Thread::CreateWithSocketServer(void) [build] >>> referenced by C:\Users\sj2003\Desktop\peerconnect_client\conductor.cc:140 [build] >>> CMakeFiles\peerconnect_client.dir\conductor.cc.obj:(protected: bool __cdecl Conductor::InitializePeerConnection(void)) [build] [build] lld-link: error: undefined symbol: public: bool __cdecl rtc::Thread::Start(void) [build] >>> referenced by C:\Users\sj2003\Desktop\peerconnect_client\conductor.cc:141 [build] >>> CMakeFiles\peerconnect_client.dir\conductor.cc.obj:(protected: bool __cdecl Conductor::InitializePeerConnection(void)) [build] [build] lld-link: error: undefined symbol: class rtc::scoped_refptr<class webrtc::AudioDecoderFactory> __cdecl webrtc::CreateBuiltinAudioDecoderFactory(void) [build] >>> referenced by C:\Users\sj2003\Desktop\peerconnect_client\conductor.cc:143 [build] >>> CMakeFiles\peerconnect_client.dir\conductor.cc.obj:(protected: bool __cdecl Conductor::InitializePeerConnection(void)) [build] [build] lld-link: error: undefined symbol: class rtc::scoped_refptr<class webrtc::AudioEncoderFactory> __cdecl webrtc::CreateBuiltinAudioEncoderFactory(void) [build] >>> referenced by C:\Users\sj2003\Desktop\peerconnect_client\conductor.cc:143 [build] >>> CMakeFiles\peerconnect_client.dir\conductor.cc.obj:(protected: bool __cdecl Conductor::InitializePeerConnection(void)) [build] [build] lld-link: error: undefined symbol: class rtc::scoped_refptr<class webrtc::PeerConnectionFactoryInterface> __cdecl webrtc::CreatePeerConnectionFactory(class rtc::Thread *, class rtc::Thread *, class rtc::Thread *, class rtc::scoped_refptr<class webrtc::AudioDeviceModule>, class rtc::scoped_refptr<class webrtc::AudioEncoderFactory>, class rtc::scoped_refptr<class webrtc::AudioDecoderFactory>, class std::unique_ptr<class webrtc::VideoEncoderFactory, struct std::default_delete<class webrtc::VideoEncoderFactory>>, class std::unique_ptr<class webrtc::VideoDecoderFactory, struct std::default_delete<class webrtc::VideoDecoderFactory>>, class rtc::scoped_refptr<class webrtc::AudioMixer>, class rtc::scoped_refptr<class webrtc::AudioProcessing>, class webrtc::AudioFrameProcessor *, class std::unique_ptr<class webrtc::FieldTrialsView, struct std::default_delete<class webrtc::FieldTrialsView>>) [build] >>> referenced by C:\Users\sj2003\Desktop\peerconnect_client\conductor.cc:143 [build] >>> CMakeFiles\peerconnect_client.dir\conductor.cc.obj:(protected: bool __cdecl Conductor::InitializePeerConnection(void)) [build] [build] lld-link: error: undefined symbol: public: __cdecl webrtc::PeerConnectionInterface::RTCConfiguration::RTCConfiguration(void) [build] >>> referenced by C:\Users\sj2003\Desktop\peerconnect_client\conductor.cc:202 [build] >>> CMakeFiles\peerconnect_client.dir\conductor.cc.obj:(protected: bool __cdecl Conductor::CreatePeerConnection(void))
What can I do to solve this problem?