To successfully compile AviSynth v3 with Microsoft Visual C++ .NET 2003, you first need to obtain some additional libraries and tools. The order in which you compile them is important, so please follow this small guide. The dependencies are the following:
- STLport (another port of the STL (Standard Template Library))
- Boost (set of libraries, written in C++, used for the parser, the threads, the pointers, etc...)
- Freetype (a high quality font engine)
- Fontconfig (library for font customization and configuration)
- Nasm (the Netwide Assembler)
I used a folder C:/tmp/ to put everything in. If you want to put the stuff somewhere else, don't forget to change the paths accordingly.
First, download the following libraries in the folder C:/tmp.
Unpack the archive STLport-5.0.2.tar.bz2 to C:/tmp (you can unpack tar.bz2 files with winzip).
Open up a command prompt and give the following commands (assuming everything ended up in a folder C:/tmp/STLPORT/):
C:/tmp/STLport> "c:/Program files/Microsoft Visual Studio .NET 2003/Common7/Tools/vsvars32.bat"
C:/tmp/STLport> cd build/lib
C:/tmp/STLport> nmake -f nmake-vc71.mak clean all
C:/tmp/STLport> cd ../../lib
C:/tmp/STLport> copy STLPORT_VC7146.dll %WinDir%/System32/
If you installed Visual Studio in a different location, don't forget to adjust the path to vsvars32.bat. Don't forget the double quotes!
- In the top menu, go to Tools, Options.
- In the Options box, select the Projects, VC++ Directories in the tree on the left.
- In the "Show directories for:" pull-down menu, choose "Include files".
- Click the "new Line" button (with the yellow folder on it).
- Browse to C:/tmp/STLport/stlport/.
- Click the "open" button.
- If the new line is not at the top of the list, use the arrow buttons on the right of the box to put the STLport path there.
- In the "Show directories for:" pull-down menu, choose "Library files".
- Click the "new Line" button (with the yellow folder on it).
- Browse to C:/tmp/STLport/lib/.
- Click the "open" button.
Close the dialog boxes and close VC.net.
Unzip the file boost_1_33_1.zip located in C:/tmp/ in this folder and, in the archive boost-jam-3.1.12-1-ntx86.zip, you will find bjam.exe. Put this file in C:/tmp/boost_1_33_1/. To compile boost, open up a command prompt and give the following commands (assuming everything ended up in a folder C:/tmp/boost_1_33_1/):
C:/tmp/BOOST_1_33_1>"c:/Program files/Microsoft Visual Studio .NET 2003/Common7/Tools/vsvars32.bat"
C:/tmp/BOOST_1_33_1>bjam "-sTOOLS=vc7.1-stlport" "-sSTLPORT_PATH=C:/tmp" --with-thread stage
You will see some errors about boost.python and file not found error's. These can safely be ignored. The only important thing is that when bjam is finished, C:/tmp/boost_1_33_1/stage/lib/boost_thread-vc71-mt-p-1_33.lib was created. Make sure that you copy this dll to your Windows system folder.
Next, add a new include path and library path, just as in Installation of STLport 5.0.2 :
- Add C:/tmp/boost_1_33_1/stage/lib/ to the Library paths.
- Add C:/tmp/boost_1_33_1/boost/ to the Include path.
Not done yet.
Not done yet.
unzip the file nasm/nasm-0.98.39-win32.zip located in C:/tmp. Rename nasmw.exe to nasm.exe.
Start up VC.net and
- In the top menu, go to Tools, Options.
- In the Options box, select the Projects, VC++ Directories in the tree on the left.
- In the "Show directories for:" pull-down menu, choose "Executable files".
- Click the "new Line" button (with the yellow folder on it).
- Browse to the folder where you unpacked nasm.
- Click the open button. The path is now added to the list.
Close the dialog boxes and close VC.net.
Right now, the source code of Avisynth 3.0 is only available on cvs. It is assumed you have installed WinCVS or TortoiseCVS, otherwise you have to do that first. You can use either the gui to get the avisynth_3_0 branch, or the command prompt (for W2K for example: go to the desktop, right click on 'My Computer' -> Properties -> Advanced tab -> Environment Variables -> select the Variable 'path' -> edit -> add the path to WinCVS/TortoiseCVS where cvs.exe is located) to get it:
Make an empty folder called: C:/tmp (or whatever). Open a command prompt and use the following commands:
cd C:/tmp
C:/tmp> cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/avisynth2 co -r avisynth_3_0 avisynth
This will get you the AviSynth v3 branch (note "co" means "check out", and "-r" will get you the branch).
Now you can compile Avisynth 3.0:
- In VC.net, go to file, open solution.
- Open C:/tmp/avs_v3/avisynth/build/win32/vc71/avisynth.sln.
- In the menu, set the solution configuration pull-down to "Release".
- In the menu, select "Buid", "Build Solution".
You now should have an avisynth.dll in C:/tmp/avs_v3/avisynth/build/win32/vc71/Release/
- The avisynth.dll file will be quite big. It can be compressed using UPX: You may need to use the -f switch to force it to pack.
- The receipt above also works with the standard edition of VC++ .NET 2003, which is also included with the learning edition. However, this version of VC contains the non-optimizing compiler. As a result, Avisynth will be a bit slower. There is a way around this: the Microsoft Visual C++ Toolkit 2003, a free download, contains the optimizing version. Install it, and go to:
C:/Program files/Microsoft Visual C++ Toolkit 2003/bin/
Copy the files c2.dll and cl.exe (do make backups of the originals first!!!) to: C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/bin/
The optimization options in the gui will still be greyed out. However, optimization switches already in a project file will be passed on to the compiler. And programs compiled on the command prompt will use it directly.
Generated on Sun Jul 30 18:46:52 2006 for Avisynth by
1.4.7