Hello everyone !
I worked with WebRTC librairies in past six months on various softphone software (AEC implementation) across 3 operating system (Windows, OSX and Android). I’ll show you how-to compile WebRTC on windows, with some interesting tips.
I’ll do other articles on OSX and Android soon.
WebRTC compiling on Windows
Preliminary note :
- WebRTC can only work with MSVC 14.0 (VS 2013+) due to C++ standard library support issue in VisualC++.
- You need knowledge on Windows Variable Environnement and eyes to read !
Getting the depot-tools
Please refer to this page to install the depot-tools (used to interact with webrtc build).
Do only Step 1 and Step 2
To achieve a good build, go to “Computer > Properties > Advanced System Settings > Environment Variables”
Add the following variable to the User Variables.
Note : you can modify GYP_DEFINES from shared_library to static_library if you want to generate static library.
Note : For 2013+ Visual Studio version, you can replace 2013 with other values (2015, …)
Getting the sources
Please refer to the following chapter of the official webrtc build guide. If the build randomly fail in the next steps, please redo this chapter from scratch.
Note : Take a break and a coffee, it’ll be very long since there are a lot of source files to get.
Updating the sources
Execute the following command under src/ folder:
git pull . origin/master gclient sync
Note: Doing “gclient sync” will regenerate .ninja/.sln files, if you did this after completing “Prepare Project” step, you’ll need to do it again.
Prepare project files
Open an Administrator command prompt, and go to the root of the source (under src folder).
In cmd prompt, type :
This should generate .sln all over the source folders.
Building the source from Command Prompt
You can now start the build by typing
ninja -C out/Debug ninja -C out/Release ninja -C out/Debug_x64 ninja -C out/Release_x64&amp;amp;amp;amp;amp;nbsp;
Note : If the x64 build fail, you may need to run before in src/ folder:
python webrtc\build\gyp_webrtc -Dtarget_arch=x64
Building the source from Visual Studio 2013
In the root folder (src), you should find “all.sln”, open it to access to all the projects files in the WebRTC folder.
Like any other else compilation, select in the toolbar the desired platform and type.
And build the “All” project in the solution (only).
1. “UTF8” error when building
This error occur when your system is not in English, please go to “Control Panel > Clock Language and Region > Region And Language > Keyboard And Language” and set display language to English.
2. gclient is not recognized
Check if the depot_tools folder is in your path, if it’s the case, close your Command Prompt and open it.
Minimum Lib needed for AudioProcessing
The following exhaustive list is the minimum library list needed to use AudioProcessing (in my implementation, it may be differente for you)
Here we are ! It should be all good ! If you have question or problems, please ask me in the comments.