Current version

v1.10.4 (stable)


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

VirtualDub documentation: compiling

It seems you can never compile someone else's application without a lot of hair pulling!
What do I need to compile VirtualDub?

You need Visual C++ 6.0 SP5 + Processor Pack and Microsoft Macro Assembler (MASM) 6.15.  The Processor Pack is a free download from Microsoft's website, although you will need to patch to SP5 first (this is mandatory anyway since some pre-SP3 bugs will cause VirtualDub to miscompile).  It also includes MASM (ml.exe) as well.  If you don't have the Processor Pack installed, the SSE instruction sfence will not compile.

What are the verinc and mapconv tools?

verinc is my automatic build number incrementer, and mapconv generates the .dbg files used to generate stack dumps on a crash. mapconv can be safely removed from the VirtualDub.exe post-build step without problems, but verstub.asm still needs to be compiled.

Download source code for mapconv and verinc from (HTTP).

How should I lay out the directory structure when I unzip the archives?

The source and auxsrc distributions can go into any directory, although VirtualDub just might be a good name for it. NekoAmp should go into amplib_new and Sylia should go into sylia, with both directories at the same level as the VirtualDub directory.


A macro constant included in recent versions of Microsoft's Platform SDK, which has newer Win32 includes than the original Visual C++ 6.0 distribution.  Install the PSDK includes or use:

VC++ says it can't find IAMPDecoder.h.

You need to install the NekoAmp source code and headers. By mistake, some of VirtualDub's modules refer to an amplib directory in their preprocessor settings; they should all be pointing to amplib_new.

VC++ says it can't find IScriptInterpreter.h.

Install the source code and headers for the Sylia scripting language in ../sylia.

When I recompile VirtualDub, the executable is over a megabyte, instead of the 380K yours is!

Don't release Debug mode builds; change the build target to "VirtualDub - Win32 Release."  (You're not supposed to ship debug executables anyway, as the Visual C++ debug RTL isn't redistributable.)

I'm building a Release build now, but it's still over 800K.

I cheated -- the release VirtualDub.exe is compacted with UPX.

Isn't assembly language dead with modern compilers?

void add_pairs(float *dst, const float *src, int count) {
	if (count) {
		do {
			float x = *src++;
			float y = *src++;

			*dst++ = x+y;
		} while(--count);

F:\test>cl /c /O2ax /G6s fpu.cpp && dumpbin /disasm fpu.obj
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

Microsoft (R) COFF Binary File Dumper Version 6.00.8447
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

Dump of file fpu.obj


?add_pairs@@YAXPAMPBMH@Z (void __cdecl add_pairs(float *,float const *,int)):
  00000000: 8B 54 24 0C        mov         edx,dword ptr [esp+0Ch]
  00000004: 85 D2              test        edx,edx
  00000006: 74 1F              je          00000027
  00000008: 8B 44 24 08        mov         eax,dword ptr [esp+8]
  0000000C: 8B 4C 24 04        mov         ecx,dword ptr [esp+4]
  00000010: D9 00              fld         dword ptr [eax]
  00000012: 83 C0 04           add         eax,4
  00000015: D9 00              fld         dword ptr [eax]
  00000017: 83 C0 04           add         eax,4
  0000001A: D8 C1              fadd        st,st(1)
  0000001C: 83 C1 04           add         ecx,4
  0000001F: 4A                 dec         edx
  00000020: D9 59 FC           fstp        dword ptr [ecx-4]
  00000023: DD D8              fstp        st(0)
  00000025: 75 E9              jne         00000010
  00000027: C3                 ret
  00000028: 90                 nop
  00000029: 90                 nop
  0000002A: 90                 nop
  0000002B: 90                 nop
  0000002C: 90                 nop
  0000002D: 90                 nop
  0000002E: 90                 nop
  0000002F: 90                 nop

What was that again?