How to compile with Windows

Prerequisites

You should install the following software first:

  • git (add to %PATH%)
  • gzip binary (add to %PATH%), needed to decompress the QCustomPlot source
  • Microsoft Visual Studio with nmake, C++ compiler, and debug tools. 2019 recommended (other versions may work too).
  • qt5, version 5.15.2 (scroll down to “Downloads for open source users”)
    • Make sure to install these optional components too:
      • qt creator
      • qmake (add to %PATH%)
  • QCustomPlot (source files), version 2.0.1 (other versions may work too)
  • Opus (use our build)

Make sure the version of qt and MSVC are compatible.

Setup

The following directory structure is recommended and how the wfview.pro file is designed to work. Assume the git command has been run from Documents/projects/wfview-master:

wfview source code: wfview-master/wfview

qcp header: wfview-master/qcustomplot/qcustomplot.h

qcp source: wfview-master/qcustomplot/qcustomplot.cpp

opus include: wfview-master/opus/include

opus library: wfview-master/opus/win32

build directory: wfview-master/build

Clone the repository

cd wfview-master
git clone https://gitlab.com/eliggett/wfview.git

Command-line Build

To build from the command line, you can use build.bat, or follow these steps:

call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars32.bat"

This sets many of the necessary environment variables. (You can also just start by launching the “x86 Native Tools Command Prompt for VS 2019”)

Now make the directory for building, enter the directory, run qmake, and then nmake (nmake is apparently microsoft’s make):

mkdir build
cd build
qmake ..\wfview\wfview.pro
nmake

The resulting file is release\wfview.exe

qtcreator Build

Launch qtcreator

Open wfview.pro

Configure the project using the standard options.

Press Build. qtcreator will create a build directory for either Debug or Release, with the objects and executable.