How to compile Google Chrome with Visual C++ 2008 Express Edition
Here is my recipe :
1. Install Visual C++ 2008 Express Edition with SP1.
2. To be on par with the official Chrome Windows build instructions, you need to install the following patches:
3. Install the Microsoft Windows 7 SDK.
4. Install the Windows Driver Kit (WDK) Version 7.0.0 which contains the ATL 7.1 headers.
Note: Earlier versions of the WDK will work too (e.g. I used WDK 6001.18002). The important thing is to get the ATL headers.
5. Register the Windows SDK with Visual C++ 2008 Express.
6. Add the ATL 7.1 include directory (e.g. C:\WinDDK\6001.18002\inc\crt\atl71) to Visual C++ 2008 Express.
8. Get the Google Chrome source code by following these instructions.
9. Apply this patch to your Chrome source tree. This will remove the “Treat Warnings As Errors” directive (i.e. /WX) from the following projects: browser, browser_tests_dll, chrome, plugin_tests, unit_tests, views and disable incremental linking (i.e. /INCREMENTAL:NO) from the sync_unit_tests project.
10. Set GYP_MSVS_VERSION=2008e in your environment variables and run gclient runhooks ––force after this change to regenerate your solution file (.sln).
11. Open the chrome/chrome.sln solution file in Visual C++ 2008 Express. When all projects are loaded, you will get a dialog with the following message: “Some of the properties associated with the solution could not be read“. Click “Ok” to dismiss it.
12. Start building the solution and go to sleep. Seriously if you didn’t buy your PC in the last 1-2 years and have less than 2GB of RAM, expect the compilation to take the night. The official build instructions talk about “10 minutes to 2 hours. More likely 1 hour” but on my P4 2.80GHz with 1GB it took way mooooore time. I’ve since upgraded to 4GB of RAM and it is much more bearable. :-)
13. You should end up with a fatal error LNK1104 in the mini_installer project but this should not bother unless you want to hack in this particular project. Now select the chrome project as the starting project, cross your fingers and press F5.
Note that your mileage may vary. Do not hesitate to contact me if you have problems, I will see what I can do. Also let me know if some of the steps are wrong or missing.
Happy Chrome hacking!
Filed under: Uncategorized | 32 Comments