Current version

v1.10.4 (stable)


Main page
Archived news
Plugin SDK
Knowledge base
Contact info
Other projects



01 Dec - 31 Dec 2013
01 Oct - 31 Oct 2013
01 Aug - 31 Aug 2013
01 May - 31 May 2013
01 Mar - 31 Mar 2013
01 Feb - 29 Feb 2013
01 Dec - 31 Dec 2012
01 Nov - 30 Nov 2012
01 Oct - 31 Oct 2012
01 Sep - 30 Sep 2012
01 Aug - 31 Aug 2012
01 June - 30 June 2012
01 May - 31 May 2012
01 Apr - 30 Apr 2012
01 Dec - 31 Dec 2011
01 Nov - 30 Nov 2011
01 Oct - 31 Oct 2011
01 Sep - 30 Sep 2011
01 Aug - 31 Aug 2011
01 Jul - 31 Jul 2011
01 June - 30 June 2011
01 May - 31 May 2011
01 Apr - 30 Apr 2011
01 Mar - 31 Mar 2011
01 Feb - 29 Feb 2011
01 Jan - 31 Jan 2011
01 Dec - 31 Dec 2010
01 Nov - 30 Nov 2010
01 Oct - 31 Oct 2010
01 Sep - 30 Sep 2010
01 Aug - 31 Aug 2010
01 Jul - 31 Jul 2010
01 June - 30 June 2010
01 May - 31 May 2010
01 Apr - 30 Apr 2010
01 Mar - 31 Mar 2010
01 Feb - 29 Feb 2010
01 Jan - 31 Jan 2010
01 Dec - 31 Dec 2009
01 Nov - 30 Nov 2009
01 Oct - 31 Oct 2009
01 Sep - 30 Sep 2009
01 Aug - 31 Aug 2009
01 Jul - 31 Jul 2009
01 June - 30 June 2009
01 May - 31 May 2009
01 Apr - 30 Apr 2009
01 Mar - 31 Mar 2009
01 Feb - 29 Feb 2009
01 Jan - 31 Jan 2009
01 Dec - 31 Dec 2008
01 Nov - 30 Nov 2008
01 Oct - 31 Oct 2008
01 Sep - 30 Sep 2008
01 Aug - 31 Aug 2008
01 Jul - 31 Jul 2008
01 June - 30 June 2008
01 May - 31 May 2008
01 Apr - 30 Apr 2008
01 Mar - 31 Mar 2008
01 Feb - 29 Feb 2008
01 Jan - 31 Jan 2008
01 Dec - 31 Dec 2007
01 Nov - 30 Nov 2007
01 Oct - 31 Oct 2007
01 Sep - 30 Sep 2007
01 Aug - 31 Aug 2007
01 Jul - 31 Jul 2007
01 June - 30 June 2007
01 May - 31 May 2007
01 Apr - 30 Apr 2007
01 Mar - 31 Mar 2007
01 Feb - 29 Feb 2007
01 Jan - 31 Jan 2007
01 Dec - 31 Dec 2006
01 Nov - 30 Nov 2006
01 Oct - 31 Oct 2006
01 Sep - 30 Sep 2006
01 Aug - 31 Aug 2006
01 Jul - 31 Jul 2006
01 June - 30 June 2006
01 May - 31 May 2006
01 Apr - 30 Apr 2006
01 Mar - 31 Mar 2006
01 Feb - 29 Feb 2006
01 Jan - 31 Jan 2006
01 Dec - 31 Dec 2005
01 Nov - 30 Nov 2005
01 Oct - 31 Oct 2005
01 Sep - 30 Sep 2005
01 Aug - 31 Aug 2005
01 Jul - 31 Jul 2005
01 June - 30 June 2005
01 May - 31 May 2005
01 Apr - 30 Apr 2005
01 Mar - 31 Mar 2005
01 Feb - 29 Feb 2005
01 Jan - 31 Jan 2005
01 Dec - 31 Dec 2004
01 Nov - 30 Nov 2004
01 Oct - 31 Oct 2004
01 Sep - 30 Sep 2004
01 Aug - 31 Aug 2004


Powered by Pivot  
XML: RSS feed 
XML: Atom feed 

§ Compiling VirtualDub with Visual C++ 2005 Express

Microsoft finally shipped the long-awaited Visual Studio 2005 this week. Although most were simply wanting a service pack for Visual Studio .NET 2003 (or even a second one for VS2002), VS2005 does have a lot of cool improvements as well. The really good news, though is that Visual C++ 2005 Express Edition is available for free download for a year:

As far as I can tell, no registration or activation is required. The Express edition does have some limitations: no 64-bit support, no source code control integration, no ATL/MFC, no Win32 resource editor, no macro assembler (MASM), and you must download and manually integrate the Platform SDK (using some ugly instructions in the help). However, it does come with the optimizing compiler, can generate 100% native executables, and does have the Threads pane that was taken out during beta 2. I highly recommend getting it, if for no other reason than that it has a very capable GUI debugger.

There are some minor changes that have to be made to the VirtualDub 1.6.11 sources to get it to compile under VC2005 Express.

Patching the VirtualDub source

Notes on the change:

I've put together an archive that contains the necessary changes, along with a pre-converted set of project and solution files:

Note that VirtualDub requires the Microsoft Macro Assembler (MASM) to build, so you must either have MASM 6.15 from the VC6 Processor Pack or MASM 7.0 from Visual Studio .NET to build 1.6.11 with VC2005 Express.

If you have VS2005 Professional or Enterprise then you can build with MASM 8, but the assembly language files have to be updated to fix syntax errors in MOVD and MOVQ instructions. The problem is that the new 8.0 assembler enforces an old rule that untyped memory references must use the same size between source and destination arguments, which breaks the following (very common) statements:

movd mm0, [ecx]
movd [ecx], mm0
movq xmm0, [ecx]
movq [ecx], xmm0

The statements must be updated to use explicit pointer types:

movd mm0, dword ptr [ecx]
movd dword ptr [ecx], mm0
movq xmm0, qword ptr [ecx]
movq qword ptr [ecx], xmm0

I'll probably fix these once I get a non-Express version of VS2005 and switch over to using it.

Evaluation of VC2005 Express RTM

The gradient toolbars are completely unnecessary. They look OK in normal use, but look nasty and take up valuable bandwidth over a remote desktop connection with reduced color depth. They're also a very odd choice of colors (3DFACE to WINDOW, when I checked in the beta).

VS2005's user interface feels snappier than that of VS2003, and I'm pleased to see that the keyboard shortcuts for VC++ have been restored to sane defaults, i.e. build is F7 and not Ctrl+Shift+B, project settings is Alt+F7, etc. The annoying "build failed ó run stale version anyway?" dialog has thankfully been made optional.

Memory-wise, the IDE still takes a lot more memory, about 150MB for VirtualDub.sln vs. 50MB for VC6. This isn't any worse than VS2003, though, and Intellisense is a lot better in 2002-2005 than in 6.0; I can actually find enums and #defines.

The project format changed again, and there's no option to save to 7.1 format. Sigh.

You can now create property sheets that automatically apply settings to projects; sharing property sheets between projects allows you to change project settings across a solution instantly. They are attached using relative paths, so they can move with the project. This is a godsend for any shared code that requires changes to dependant projects, particularly for include and lib paths. Barring unforeseen annoyances, I forsee this to be a very popular option. One complaint is that it's a bit annoying to attach and unattach them to projects, especially if you only want to apply it for some configurations.

I like the movement by Microsoft towards greater standards compliance, and I can't complain about adding features that encourage secure code. However, I think that deprecating a ton of Standard C++ functions by default as being insecure even though (a) they're not deprecated in the C++ standard and (b) most aren't inherantly insecure, but only when used in an insecure manner, was a poor choice. Not all C string functions are gets(). It's really annoying to anyone who wants to write portable code. And frankly, I don't consider adding a NULL pointer check to be added security. We're in protected mode; it'll crash.

Managed C++'s new syntax looks much less underlineful. Maybe with a few more revisions I'll actually consider using it. I like the "for each" keyword, especially since it can be used with native STL and even custom classes, but I would have preferred typeof/decltype/auto support instead.

Lots of long overdue goodies added ó variadic macros, __movsd(), and __restrict. Keep 'em coming.

The compiler hasn't crashed or munged my code yet. I'll try harder.

The help system seems slower, but supposedly there's been a lot of work put into improving the categorization. The real test will be when I get a version of VS2005 that has the Platform SDK preinstalled. I will be docking one point from the grade for every time I get Windows CE documentation, two points for each page on the .NET Framework, and five points for MAPI while looking up KERNEL32 calls.

The really awful bug introduced in the build system starting with Visual Studio .NET 2002 that caused delays of ~1 second per project during dependency checking has now been fixed; up-to-date projects are skipped almost instantly. I still maintain that this bug, which can add well over 30 seconds to a compile-run cycle in a large project, should have been considered recall-class and that Microsoft is obligated to patch it for both VS2002 and VS2003, but at least we won't have to suffer through it for VS2005. This means that Fast Solution Build ó which unfortunately crashed on C# projects ó is no longer essential.

Debug output speed is still very poor in VS2005, unfortunately. VS2002/2003 are an order of magnitude slower than VC6 at receiving debug output (OutputDebugString) from a debugged application; it's literally so bad that if debug output is being spammed you can watch the text scroll by and the IDE will be stuck processing it for several seconds after you issue the Stop (Shift+F5) command. The reason for the horrible slowness is that every debug message is sent as a separate call that has to be marshalled into the UI layer's single-threaded apartment (STA) by COM, and the UI updates the pane for every single line. VC6 cheated since it would drop chunks of debug output under high load, but the NT system debugger (NTSD) doesn't drop a single line and is just as fast as VC6 in this regard. You probably don't know why this is important unless you've tried debugging a 3D application and gotten boatloads of the useless warning:

Direct3D9: (WARN) :Can not render to a render target that is also used as a texture. A render target was detected as bound, but couldn't detect if texture was actually used in rendering.

...spammed into the Output pane. VS2005 is about one-third faster at receiving debug output, but still has a long way to go; the UI team sparsed the pane updates to kill the redraw overhead, but the significant marshaling overhead is still there. Oh well, I guess I'll be hot-patching WaitForDebugEvent() and ReadProcessMemory() on the debugger again.

Not that I've tried it on an industrial-strength program yet, but debugging native code in mixed-mode is sooooo much faster in VS2005 than in VS2003 it's not even funny. Mixed-mode allows you to debug a process that contains both managed and native code (I refused to call it "unmanaged") by effectively attaching both kinds of debuggers. The problem is that debugging native code in this mode in VS2003 is painfully slow; stepping between lines has a noticeable delay, and the already poor debug output speed drops to about three per second. In VS2005, stepping and output is almost instantaneous. I gave Microsoft a bit more slack on this one because it's a tougher problem than buffering debug output, and I'm glad to see that the situation has greatly improved.

Tracepoints, which are breakpoints that trigger a formatted message or a macro rather than a break in execution, are a lot more useful than they seem at first. It's nice that you don't have to recompile the code to insert a trace, but where they really come in handy is when you realize they can dump registers in the middle of raw assembly code! Manually inserting a trace call in the middle of an asm IDCT routine is not fun in comparison. I foresee lots of interesting uses for this.

The STL visualization is nice, especially since you can customize it. Although it's not advertised as such, it also bypasses an annoying restriction in regular AUTOEXP.DAT expressions, namely that you cannot reference more than one field in an expansion, which made expansions like std::vector<*>=size:{_M_last-_M_first} impossible.

Overall, I'm pleased so far. When I got my hands on the VS2002 beta, I thought, "man, this sucks, good thing it's a beta." Then we got VS2002 final and it still sucked. My initial experience with VS2005 has been pretty good so far, so I'm optimistic. And at least this time I can bitch on the Product Feedback site.


Comments posted:

Hope Virtualdub never becomes dependant on .NET ...

PJ - 11 11 05 - 10:40

I read somewhere that VS2003 SP1 will arrive in April 2006, and SP1 for 2005 sometime first half 2006 (which will probably be pushed to second half or even 1H 2007).
My own personal annoyance with 2005 Express (so far) is that the Call Graph is pretty random in when it wants to work and when not.

As for registration, I believe that if you download the cd image and install from that, you don't need to register or activate or anything, but if you download the installer that downloads stuff itself, you'll need to register to get a serial (otherwise 30 day limit).

And personally I kinda doubt that they will really go pay for Express after this one year promotion is over. It feels very pointless :p

Nekoneko - 11 11 05 - 14:57

Microsoft does it right. Gives away .NET IDE for free, so everybody has one year to get used to it although there are other and better IDEs. The best IDE is still a free IDE. Sun just recently did the same with their Java IDE.
Look at divx versus wmv:
Everyone knows wmv sucks, but because you get moviemaker 2 for free, everybody is using it instead of divx.

Murmel - 12 11 05 - 04:35

You don't have to worry about that.

Yes, the automatic download does require registration (activation, really). The manual download doesn't, though, according to the FAQ. I hope VS never goes to requiring activation for all editions, because it'd be a nightmare (the EULA allows you to install it on multiple machines that you're working with).

What you say may be true for .NET development, but for native C++ development, I haven't seen an IDE for Windows that was better than Visual C++, even with all its warts. Eclipse seemed more unconfigurable and unusual than VC++. What kills most IDEs is debugging support; parsing the text output of gdb is not my idea of a high-quality debugger.

Phaeron - 12 11 05 - 16:25

Now all we need is Intel ICL for free, free icsharp ide, and we'll have GNU GCC4+mono! Whoa!

Justin Goldberg - 14 11 05 - 16:09

Hi Avery,

Thanks very much for the overview of VS2005 (Express). Iíve been playing with VC++ 2005 Express for a couple of days now, and I think I prefer it over VS2003 (the slow dependency check nearly drove me mad as well Ė thanks for the tip ages ago on Fast Solution Build). One other neat thing it can (finally!) do is fire off multiple building threads.

Iíd be interested in hearing your opinions on the optimising compiler. I gave it a quick go at my current project, and the performance was pretty much the same as VS2003. I havenít yet had a serious go at profiling the code, so I donít know if I just havenít turned on/off the right options.

mikel - 14 11 05 - 17:59

I haven't worked with it enough to be sure, but I would be surprised if there were any huge improvements. VC7.1 could compile code to be 10-15% faster than VC6 with LTCG if you had complex code, but that wasn't a given, and it's unnoticeable in practice. SSE intrinsic code generation was improved slightly, but it's still nowhere near as good as Intel C/C++ was two years ago.

What VC8 does give you is a more generous set of scalar intrinsics, and the all-important __restrict keyword, which lets you stomp aliasing concerns without breaking STL. It also has profile guided optimization support. I wouldn't expect your code to magically get faster, but you will have more hints to aid the compiler in achieving that.

MMX code generation still sucks rocks in VC8, and SSE/SSE2 is still problematic, so I expect I will be writing just as much assembly language with it than with VC7.1. The compiler's job is to generate reasonably good code for 95% of my program; it's my job to write super-optimized code for the remaining 5% that really matters.

Phaeron - 16 11 05 - 02:37

Hi, I'm really new to coding (can't really code a line for the life of me) and I can't find the Microsoft Macro Assembler (MASM). Could somebody give me a link.
By the way, is it even free?

I've got the free VSC++ Express but when I try to compile Virtualdub I get lots of errors. Could someone explain how I compile it correctly and what I need to do to optimize it for my computer.

Sven - 19 11 05 - 19:30

Yeah, I'd like to know the answer to Sven's question too as I'm having the same problem he is.

Richard - 21 11 05 - 22:33

Sorry, but you need a valid copy of MASM 6.15 or higher in order to compile VirtualDub. As far as I know, the only valid way to get it is to have Visual C++ Professional 6.0 and to install the Processor Pack, or VS2002/2003/2005 Professional, which ship with MASM 7 and 8, respectively. As far as I know there is no free way (legal, at least) to obtain a recent version of MASM. Some versions of the Windows DDK have an older version which may work, and the DDK can be obtained inexpensively (~$18), but I haven't tried it. At this point, you're deep into "not a supported build platform" territory.

I would ask that if you plan to do this, that you have a modicum of experience in programming and in using Visual Studio. There are no easy switches that can be flipped to get a huge boost in VirtualDub's performance.

Phaeron - 22 11 05 - 00:12

I installed all those Express packages 2 weeks ago and they are still sleeping on my Disk. Now I know a lot of what to expect, thanks.
But what about VD? Is there any change in performance? (This moment, it would be the only reason to wake it up)

Ronie - 28 11 05 - 05:15


First congratulations for the excellent VirtualDub.

Visual Studio .NET 2003 and 2005 are good IDEs. Moreover, the last one is free for 1 year. Anyway, a good alternative is CodeBlocks Studio (, which is open source, cross-plaform and support the free MS Toolkit 2003 (and many other compilers).

Best wishes,

Michael - 30 11 05 - 11:49

I downloaded the Express Edition but was able to get the Professional Edition. The interface seems to be about the same speed to me ... but I don't like the bulky Office look, maybe I need to get use to it.

I think all Visual Studio's IDEs are better than the others out there. Sometimes is funny to listen to teachers talk about designing GUIs in Visual Studio ... is like the electronic version of "back in the days we walk 20 miles in 10 ft snow to get to school." :-)

meanie - 01 12 05 - 04:49

Hi again,

Phaeron, I'm sorry if you didn't understand - First off, Speed counts alot when processing large video files, and I'm also trying to learn to code here! I thought I could experiment with Virtualdub and see what is different in say Virtual dub compared to the VirtualdubMPEG-2 etc. As this is opensource, I was hoping to learn how professionals code right off the bat. And since I don't want to spend the time or money on a course I want to teach myself. Let's just call it a learning experience (I am a student and that's who the Express edition is aimed at).

I hope you understand my postition and what I want to try to do now. Heck, I was just trying to see if I could actually compile anything at first!

Thanks to everyone for their comments - they really helped alot!

Sven - 05 12 05 - 23:13

There is a way to get MASM legally and for free. The latest version of Microsoft DDK (Windows Server 2003 SP1 DDK) contains MASM 7.10.4035. That DDK is included in the recently released KMDF 1.0, which can be downloaded for free ( Although I donít know if that version of MASM is good enough to build VirtualDub.

Sergei - 15 12 05 - 04:42

Regarding the "secure" functions in VS2005...

We are also working very closely with SC-22/WG-14 (the C Language Committee) on TR 24731. This Technical Report will be an addendum to the ISO/IEC 9899:1999 (E) and it provides a specification for safer, more secure C library functions. For example: it specifies strcpy_s which is a safe version of strcpy. Visual C++ 2005 ships with an implementation of this Technical Report.

TR 24731: Safer C library functions

WG14 is working on a TR on safer C library functions. This TR is oriented towards modifying existing programs, often by adding an extra parameter with the buffer length. The latest draft is in document N1146. A rationale is in document N1147. This is to become a Technical Report type 2.

krick - 06 07 06 - 18:11

It looks like it messed up my links in the previous post.
Here are the corrected links...

krick - 06 07 06 - 18:13

A registration for the Express Edition 2005 is needed if you wan't to kepp it for more than thirty days...

Johan - 15 03 07 - 12:04

Comment form

Please keep comments on-topic for this entry. If you have unrelated comments about VirtualDub, the forum is a better place to post them.
Remember personal info?

Email (Optional):
Your email address is only revealed to the blog owner and is not shown to the public.
URL (Optional):
Comment: /

An authentication dialog may appear when you click Post Comment. Simply type in "post" as the user and "now" as the password. I have had to do this to stop automated comment spam.

Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.