Building wxSA on Windows

From LSDevLinux
Revision as of 12:22, 14 October 2010 by Mayhewn (talk | contribs) (Remove categorization)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

There is an MS Makefile (for use with NMAKE and Visual Studio) called 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, 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 to C:\wx
  2. Copy include\wx\msw\setup0.h to include\wx\msw\setup.h
  3. Edit build\msw\ 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 >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

  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
      • \src\wxWindows\lib\vc_dll\mswud \src\wxWindows\include
      • _Prefix\SAprefix.h