Failed to link my webrtc.lib to WebRTCPlugin

I follow the https://webrtc.github.io/webrtc-org/native-code/development/ to build my webrtc because I want to add some metadata to VideoFrame. But when I integrate webrtc.lib to WebRTCPlugin. It have build error:

error LNK2019: unresolve refrence "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl rtc::IPAddress::ToString(void)const " (?ToString@IPAddress@rtc@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ),function "public: struct Candidate & __cdecl Candidate::operator=(class cricket::Candidate const &)" (??4Candidate@@QEAAAEAU0@AEBV0cricket@@@Z) is referenced
1>WebRTCPlugin.obj : error LNK2019: unresolve refrence "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl rtc::SocketAddress::ToString(void)const " (?ToString@SocketAddress@rtc@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ),function "public: struct Candidate & __cdecl Candidate::operator=(class cricket::Candidate const &)" (??4Candidate@@QEAAAEAU0@AEBV0cricket@@@Z) is referenced

It looks like my webrtc does not include some thirdparty? My webrtc source code checkouts out from branch-heads/4389 as mentioned in com.unity.webrtc readme.
But branch-heads/4389 commit id is

commit e7d9f74b256605556726c64dacd518a105ba872f (HEAD, branch-heads/4389)
Author: Tomas Gunnarsson <tommi@webrtc.org>
Date:   Wed Feb 24 22:22:56 2021 +0100

    [Merge M89] - Change the safe SCTP MTU size to 1191

    TBR=tommi@webrtc.org
    (cherry picked from commit c50097798342271431bac0ee1abf0b5ce7d61dfb)

    Bug: webrtc:12495, chromium:1182634
    Change-Id: Ie149391a5a9f61095cf3f31db141c9bbc8be8bee
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/208642
    Reviewed-by: Taylor <deadbeef@webrtc.org>
    Reviewed-by: Philipp Hancke <philipp.hancke@googlemail.com>
    Commit-Queue: Tommi <tommi@webrtc.org>
    Cr-Original-Commit-Position: refs/heads/master@{#33338}
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/211350
    Reviewed-by: Tommi <tommi@webrtc.org>
    Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
    Cr-Commit-Position: refs/branch-heads/4389@{#7}
    Cr-Branched-From: 7acc2d9fe3a6e3c4d8881d2bdfc9b8968a724cd5-refs/heads/master@{#32986}

It is not the same as https://groups.google.com/g/discuss-webrtc/c/Zrsn2hi8FV0/m/KIbn0EZPBQAJ
My build argument of webrtc is

gn gen out/Debug --ide=vs2019 --args="is_debug=true target_cpu=\"x64\" enable_iterator_debugging=false"
ninja -C out/Debug

Do I have someting wrong in build webrtc of myself.

Have you read the README file?
https://github.com/Unity-Technologies/com.unity.webrtc/blob/develop/Plugin~/README.md

Sorry for that. I miss https://github.com/Unity-Technologies/com.unity.webrtc/blob/develop/BuildScripts~/build_libwebrtc_win.cmd. Follow this script. I build my own webrtc library to link it successfully.
thanks

1 Like

Did you build webrtc.dll from your own webrtc build? How you organized the .lib and .h files like webrtc-win.zip? Where is the webrtcd.lib?

What kind of issue do you have?