Skip to content

Chromium compiles with VS Express

Finally it is possible to compile Google’s Chrome with Express (free) version of Visual Studio. Thanks to Dominic Jodin who collected all bits and pieces needed for the task. I have also tried and experimented with free version of VS before, when Chromium was first released, but I couldn’t got it to work. Main showstopper at the time was lack of ATL library which does not come with free version of VS. Now for some reason Microsoft is shipping newer ATL with WinDDK, which makes it possible to also use it from Visual Studio Express.

I have decided to give it a try and see how simple or difficult it is. Actually it was more or less straightforward, albeit time consuming. Computer in question is, from developer point of view clean, no IDE’s, compilers and libraries installed. It is 2Ghz core duo laptop with 4gb of RAM. Everything went more or less fine, as in Dominic’s guide, but for the “less” part, I have run into few problems, probably because the OS is Vista, rather than XP (I think) and below is short summary.

I have installed Express version of VS, then Windows SDK and Windows DDK. While SDK updated VS paths automatically, for DDK I had to manually add include directory for headers (ATL and api) and also library directory for linker. After that I have installed all updates as listed on Dominic’s site.

Another problem seems to have with Vista to do. Patch utility, one from GNUWin32 project, crashes halfway through the patching. Since this is my girlfriends laptop, to keep it clean, I didn’t want to install MSYS or Cygwin (and I didn’t have patience neither). Instead I have patched atlthunk.h manually (as described here):

PVOID __stdcall __AllocStdCallThunk();
VOID  __stdcall __FreeStdCallThunk(void*);

I have also added this code:

namespace ATL
	inline void * __stdcall __AllocStdCallThunk()
		return ::VirtualAlloc(0, sizeof(_stdcallthunk), MEM_COMMIT 
                           | MEM_RESERVE, PAGE_EXECUTE_READWRITE);

	inline void __stdcall __FreeStdCallThunk(void *p)
		if (p) ::VirtualFree(p, 0, MEM_RELEASE);

For the second patch I have manually changed settings for projects as listed on Dominic’s site. While at changing settings I have also unloaded mini_installer and mini_installer_test projects since they don’t compile in Express version.

I also had an error related to PATH variable. When I tried to run gclient for the very first time I got error that some file called cscript is not found. I have never heard of this file before so I did search on computer and found it in system32 directory. Now this directory has been automatically searched for binaries in XP, but it maybe is not case in Vista? However by adding system32 dir to PATH, gclient was able to run and rest followed out without problems.

Below is an obligatory screenshot (Chromium themed with a theme):
Being able to compile with free version of VisualStudio Express is really great since it gives chance to many more people to play with the code, and possibly contribute. I believe that Google team should spend more time to polish the build and make it able to compile with less hassle, out of the box. They should also award Dominic with at least a free lunch for making it possible :-).

Post a Comment

Your email is never published nor shared. Required fields are marked *