Compiling CsoundAV

(for expert programmers only)

At present time, the executables of CsoundAV are compiled using Microsoft
Visual C++ Developer Studio version 5.0. The projects, workspaces and makefiles
provided with the sources are generated with this compiler. A Developer
Studio workspace can contain several projects (it is the case of CsoundAV
workspace).

CsoundAV Workspace is provided with three main projects:

CsoundVST (an attempt to turn Csound into a
VST Plugin. This is a very alpha version, and I don't recommend to attempt
to use it, because it is very unreliable and instable)

CsoundAV_Con is the console-based version
of CsoundAV

CsoundAV_Win is the GUI version of CsoundAV

Both CsoundAV_Con and CsoundAV_Win projects are
provided with four Configurations:

Win32 Debug

Win32 Release

Win32 double Debug (64-bit floating point version)

Win32 double Release (64-bit floating point version)

To build one or more targets of CsoundAV you can

use the provided makefiles ("CsoundAV_Con.mak" and
"CsoundAV_Win.mak") with nmake or

open the workspace named "CsoundAV_Win.dsw" with Microsoft
Visual C++ Developer Studio version 5.0

If you are using Developer Studio, be sure to activate the correct project
and Configuration first.

Even if later version of Visual C++ should be compatible with earlier ones,
actually, this is not always true, since I noticed that many users run into
difficulties when attempting to compile CsoundAV with a version of MSVC different
from the 5.0. In this case you should reconstruct the Project by scratch,
and I give the following suggestions:

Include all source files contained in the project of old MSVC version.

Set all global macro #defines (for each project you intend to build)

Set the runtime library type to Multithreaded

Provide special libraries and include files (for DirectSound, EAX and Paintlib)

Set alternative include directory paths and library paths (if you put the
special libraries in a custom directory)

Set particular compilation directives (different from project defaults) for
some special files

1. Including source files

You can see the files to include by opening a project file (with extension
.dsp) with a text editor and by observing included files having C, CPP, and
CXX extension. For example:

3. Setting Runtime Library Type

You have to set the runtime library to "Debug Multithreaded" for "Win32
Debug" and "Win32 double Debug" configurations and "Multithreaded"
for "Win32 Release" and "Win32 double Release" configurations:

4. Providing special libraries

Special libraries are needed to make a full compilation of CsoundAV. These
libraries (together with their include files) should be put in MSVC include
directory and lib directory or in a custom user path. In the last case you
have to provide this path to each project.

note: you can avoid to provide this library if you don't have a soundblaster
Live or you don't intend to use EAX 3D sound extensions in CsoundAV. To do
that, simply delete the GAB_EAX macro define in the corresponding project

Paintlib:

all include files of paintlib plus paintlib.lib, libtiff.lib, libjpeg.lib,
libpng.lib
You can get paintlib sources at the following URL:

Once you placed the include and lib files in a directory, you have to add
the library to the link directory options. To do that, you have to select
"Project-Settings" and the "Link" tab of the Settings dialog box, then filling
the "Object/library modules" text field with the required libraries:

5. Setting additional directory paths for include files and libraries

If you placed the special library in a path different from
..\DevStudio\VC\lib and corresponding include files in a path different
from ..\DevStudio\VC\include, you have to provide the custom directories
where you placed these libraries, by setting corresponding path in the
Project-Setting dialog box:

... and ...

6. Setting particular compilation directives (different from project defaults)
for some special files

Some source files have project settings slightly different from project defaults.
These are:

sfont.c

with this file you have to set "Struct member alignment" to "1 Byte":

rtaudio2.c, aops.c and lptrkfns.c

probably due to a bug of MSVC 5.0 with these files you have to remove all
speed optimizations except: