Skip to content

Building wxSA on Windows

marksvc edited this page Jun 18, 2021 · 2 revisions

There is an MS Makefile (for use with NMAKE and Visual Studio) called Makefile.vc. It is intended to be very similar to the Unix Makefile, so that the two can be kept in sync.

It can be run using nmake -f Makefile.vc, although the expectation is that it will be used as part of an “external build” project with Visual Studio. Instructions for setting this up are given below.

The makefile makes use of the wx recommendation to have an environment variable called WXWIN that contains the path of the directory where wx is downloaded and built. This enables the makefile to be independent of the specific location of wx. SA also uses a library called libsndfile, and this should get similar treatment (ie a variable called SNDFILE that is used in the makefile).

Eventually, it would best to create a Bakefile-based build system, but this will take time to develop.

These are the steps needed to set up and build SA on Windows:

Download and build wxWidgets

  1. Check out http://svn.wxwidgets.org/svn/wx/wxWidgets/tags/WX_2_8_7 to C:\wx
  2. Copy include\wx\msw\setup0.h to include\wx\msw\setup.h
  3. Edit build\msw\config.vc and set:
    1. BUILD = debug
    2. SHARED = 1
    3. UNICODE = 1
  4. In a command prompt:
    1. vcvars32
    2. cd build\msw
    3. nmake -f makefile.vc >make.out 2>&1
  5. Add WXWIN=... to the environment

Note: This uses svn and make, but using a zip/setup.exe and a VS project build also works. The two are fully compatible, and it is possible to build the samples using their VS project file after building the main libs with nmake.

Install the pre-built libsndfile:

  1. Unzip to C:\
  2. In a command prompt:
    1. cd \libsndfile-1_0_17
    2. vcvars32
    3. lib /machine:i386 /def:libsndfile-1.def
  3. Add SNDFILE=... to the environment

Set up a VS project based on Makefile.vc:

  1. New -> Project From Existing Code...
    1. Project file location:
      • Src\SaExe
    2. Project name:
      • SpeechAnalyzer
    3. Use external build system:
      • nmake -f Makefile.vc8 all
      • nmake -f Makefile.vc8 clean all
      • nmake -f Makefile.vc8 clean
      • build\SAminimal.exe
      • WIN32 _WINDOWS NOPCH _VC80_UPGRADE=0x0600 _DEBUG _UNICODE UNICODE WXUSINGDLL
      • \src\wxWindows\lib\vc_dll\mswud \src\wxWindows\include
      • _Prefix\SAprefix.h